主题:九九乘法表和口决
//乘法表
string str;
Label1.Text = "";
for (int num = 1; num <= 9; num++)
{
for (int j = 1; j <= num; j++)
{
str = Convert.ToString(num) + "*" + Convert.ToString(j) + "=" + Convert.ToString(num * j) + " ";
Label1.Text += str;
}
Label1.Text += "<br>";
}
//口诀表
int chengji;
string[] number = new string[81]{ "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十", "三十一", "三十二", "三十三", "三十四", "三十五", "三十六", "三十七", "三十八", "三十九","四十","四十一","四十二","四十三","四十四","四十五","四十六","四十七","四十八","四十九","五十","五十一","五十二","五十三","五十四","五十五","五十六","五十七","五十八","五十九","六十","六十一","六十二","六十三","六十四","六十五","六十六","六十七","六十八","六十九","七十","七十一","七十二","七十三","七十四","七十五","七十六","七十七","七十八","七十九","八十","八十一"};
for (int num1 = 1; num1 <=9; num1++)
{
for (int i =1; i <=num1; i++)
{
chengji = num1 * i;
str = number[i-1] + number[num1-1] + "得" + number[chengji-1] + "  ";
Label2.Text += str;
}
Label2.Text += "<br>";
}
string str = "";//字符串保存所有输出
for (int num = 1; num <= 9; num++)
{
for (int j = 1; j <= num; j++)
{
int date1 = j;//第1个数字
string flag = "x";//乘号
int date2 = num;//第2个数字
string equal = "=";//等号
int result = j * num;//计算结果
string space = " ";//空格
str = str + date1 + flag + date2 + equal + result + space;//字符串拼接。
}
str = str + "<br/>";//拼接换行字符串
}
Label1.Text = str;
信息来源[url]http://www.gobenetzsfcp.cn[/url]
string str;
Label1.Text = "";
for (int num = 1; num <= 9; num++)
{
for (int j = 1; j <= num; j++)
{
str = Convert.ToString(num) + "*" + Convert.ToString(j) + "=" + Convert.ToString(num * j) + " ";
Label1.Text += str;
}
Label1.Text += "<br>";
}
//口诀表
int chengji;
string[] number = new string[81]{ "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十", "三十一", "三十二", "三十三", "三十四", "三十五", "三十六", "三十七", "三十八", "三十九","四十","四十一","四十二","四十三","四十四","四十五","四十六","四十七","四十八","四十九","五十","五十一","五十二","五十三","五十四","五十五","五十六","五十七","五十八","五十九","六十","六十一","六十二","六十三","六十四","六十五","六十六","六十七","六十八","六十九","七十","七十一","七十二","七十三","七十四","七十五","七十六","七十七","七十八","七十九","八十","八十一"};
for (int num1 = 1; num1 <=9; num1++)
{
for (int i =1; i <=num1; i++)
{
chengji = num1 * i;
str = number[i-1] + number[num1-1] + "得" + number[chengji-1] + "  ";
Label2.Text += str;
}
Label2.Text += "<br>";
}
string str = "";//字符串保存所有输出
for (int num = 1; num <= 9; num++)
{
for (int j = 1; j <= num; j++)
{
int date1 = j;//第1个数字
string flag = "x";//乘号
int date2 = num;//第2个数字
string equal = "=";//等号
int result = j * num;//计算结果
string space = " ";//空格
str = str + date1 + flag + date2 + equal + result + space;//字符串拼接。
}
str = str + "<br/>";//拼接换行字符串
}
Label1.Text = str;
信息来源[url]http://www.gobenetzsfcp.cn[/url]