标签:gen 最小 乘法口诀 ati rgs main auto generate method
//乘法口诀表
package YunSuanFu;
public class Xuexi {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int x = 1; x <= 9; x++)
{
for(int y = 1;y<=x;y++)
{
System.out.print(y+"*"+ x +"="+y*x+"\t");
}
System.out.print("\n");
}
}
}
//比大小,输出最小值
int a=1;
int b=2;
int c=3;
if(a<b&a<c){
System.out.println("输出最小值:"+a);
}else if(b<c&b<a){
System.out.println("输出最小值:"+b);
}else if(c<a&c<b){
System.out.println("输出最小值:"+c);
}
}
}
结果:最小值为1
//阶乘
int a = 0;
int b =1;
for(a=1;a<=10;a++){
b = b*a;
}
System.out.println(b);
结果为:3628800
//求和
int x = 0;
int y = 0;
for(x=1;x<=10;x++){
y = y+x;
}
System.out.println(y);
结果为:55
标签:gen 最小 乘法口诀 ati rgs main auto generate method
原文地址:http://www.cnblogs.com/baichaofeng123/p/7019840.html