Go: package main

import (
	"fmt"
	"strconv"
)

func main() {
	for _, leftValue := range MultiplicationTableNum(9) {
		for _, rightValue := range MultiplicationTableNum(9) {
			strLeftVal, strRightVal, strMulti := strconv.Itoa(leftValue), strconv.Itoa(rightValue), strconv.Itoa(Multiplication(leftValue, rightValue))
			fmt.Println(strLeftVal + "x" + strRightVal + "=" + strMulti)
		}
	}
}

func MultiplicationTableNum(num int) []int {
	multiNum := []int{}
	for i := 1; i <= num; i++ {
		multiNum = append(multiNum, i)
	}
	return multiNum
}

func Multiplication(x, y int) int {
	return x * y
}

C++: #include<stdio.h>

int main(){
int x,y,z;
for(x=1;x<=9;x++){
   for(y=1;y<=9;y++){
      z=x*y;
      printf("%dx%d=%d\n",x,y,z);
    }
}

return 0;
}

C++: - submit, private

C++: #include<stdio.h>
int a, b;int main(){for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };


int main() {
#ifdef _DEBUG
	printf( "debug\n" );
#endif
	for ( int i = 1; i < 10; i++ ) {
		for ( int j = 1; j < 10; j++ ) {
			printf( "%dx%d=%d\n", i, j, i + j );
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string.h>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;

const int MaxN = 2000 + 20;
int map[MaxN][MaxN];

void gen(int N){
    cout << N << endl;
    for (int i=1;i<=N;++i)
        for (int j=1;j<=N;++j)
            printf("%d%c",map[i][j]=rand()%100<5?0:1,j==N?'\n':' ');
    int Sx,Sy,Tx,Ty;
    do{
        Sx=rand()%N+1;
        Sy=rand()%N+1;
    }while (!map[Sx][Sy]);
    do{
        Tx=rand()%N+1;
        Ty=rand()%N+1;
    }while (!map[Tx][Ty]);
    printf("%d %d %d %d\n",Sx,Sy,Tx,Ty);
}

int main(){
    int T = 10;
    while (T--) gen(10);
    T = 5;
    while (T--) gen(1000);
    return 0;
}

C++: #include<stdio.h>
#include <string>
#include <iostream>
using namespace std; 
int main(){
 
 
for(int i=1;i<10;i++)
for(int j=1;j<10;j++)
cout<<i<<"x"<<j<<"="<<j*i<<endl;
    return 0;
}

C++: #include<stdio.h>

int main(){
    int num1,num2;
    for(num1=0;num1<10;num1++){
       for(num2=0;num2<10;num2++){
           printf("%dx%d\=%d",num1,num2,num1*num2);
        }
    }
    return 0;
}

C++: #include<cstdio>
#include<vector>
#include<algorithm>
#include<iostream>
#include<cassert>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<string>
using namespace std;
typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

const int SIZE=10000;

struct edge{
    int to,cost;
    edge(int to,int cost):to(to),cost(cost){}
};

int N,K;
vector<edge>G[SIZE];

bool centroid[SIZE];
int subtree_size[SIZE];

int ans;

int compute_subtree_size(int v,int p){
    int c=1;
    rep(i,G[v].size()){
        int to=G[v][i].to;
        if(to==p||centroid[to])continue;
        c+=compute_subtree_size(to,v);
    }
    subtree_size[v]=c;
    return c;
}

pint search_centroid(int v,int p,int t){
    pint res=mp(INT_MAX,-1);
    int s=1,m=0;
    rep(i,G[v].size()){
        int to=G[v][i].to;
        if(to==p||centroid[to])continue;
        res=min(res,search_centroid(to,v,t));
        m=max(m,subtree_size[to]);
        s+=subtree_size[to];
    }

    m=max(m,t-s);
    res=min(res,mp(m,v));
    return res;
}

void enumerate_paths(int v,int p,int d,vint &ds){
    ds.pb(d);
    rep(i,G[v].size()){
        int to=G[v][i].to;
        if(to==p||centroid[to])continue;
        enumerate_paths(to,v,d+G[v][i].cost,ds);
    }
}

int count_pairs(vint &ds){
    int res=0;
    sort(ds.begin(),ds.end());
    int j=ds.size();
    rep(i,ds.size()){
        while(j>0&&ds[i]+ds[j-1]>K)j--;
        res+=j-(j>i?1:0);
    }
    return res/2;
}

void solve_subproblem(int v){
    compute_subtree_size(v,-1);
    int s=search_centroid(v,-1,subtree_size[v]).second;
    centroid[s]=true;

    rep(i,G[s].size()){
        if(centroid[G[s][i].to])continue;
        solve_subproblem(G[s][i].to);
    }

    vint ds;
    ds.pb(0);
    rep(i,G[s].size()){
        if(centroid[G[s][i].to])continue;
        vint tds;
        enumerate_paths(G[s][i].to,s,G[s][i].cost,tds);

        ans-=count_pairs(tds);
        ds.insert(ds.end(),tds.begin(),tds.end());
    }

    ans+=count_pairs(ds);
    centroid[s]=false;
}

int main(){

    while(scanf("%d%d",&N,&K),N||K){
        rep(i,N)G[i].clear();
        ans=0;

        rep(i,N-1){
            int a,b,c;
            scanf("%d%d%d",&a,&b,&c);
            a--;b--;
            G[a].pb(edge(b,c));
            G[b].pb(edge(a,c));
        }

        solve_subproblem(0);
        printf("%d\n",ans);
    }

    return 0;
}

C++: #include <cstdio>

using namespace std;

int main() {
    for (int i = 1; i < 10; i++) {
        for (int j = 1; j < 10; j++) {
            printf("%dx%d=%d", i, j, i * j);
        }
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            cout << i << "x" << j << "=" << i * j << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int i,j;
	for(i=1;i<=9;i++)
	{
		for(j=1;j<=9;j++)
		{
			cout<<i<<"*"<<j<<"="<<i*j<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
	int i,j;
	for (i = 1; i <=9; i++) {
		for (j = 1; j <= 9; j++) {
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;

int main(){
	for(int i=1;i<10;i++)
		for(int j=1;j<10;j++)
			printf("%dx%d=%d\n",i,j,i*j);
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	for (int i = 1; i <= 9; i++)
	{
		for (int j = 1; j <= 9; j++)
		{
			cout << i << 'x' << j << '=' << i * j << endl;
		}
	}

	return 0;
}