标签:
public class jiajian{
public static void main(String args[]){
int i,a=13,b=23,result=0;
for(i=1;i<=49;i++){
result=result+a-b;
a=a+20;
b=b+20;
}
System.out.println("结果为:"+result);
}
}
public class jiecheng{
public static void main(String args[]){
int i,sum=1,total=0;
for(i=1;i<20;i++){
sum=sum*i;
total=total+sum;
}
System.out.println("和为:"+total);
}
}
public class shuixianhua{
public static void main(String args[]){
int i,a,b,c,d;
for(i=100;i<1000;i++){
a=i/100;
b=i/10%10;
c=i%10;
if(a*a*a+b*b*b+c*c*c==i){
System.out.println("水仙花数:"+i"\t");
}
for(i=1000;i<10000;i++){
a=i/1000;
b=i/100%10;
c=i/10%10;
d=i%10;
if(a*a*a+b*b*b+c*c*c+d*d*d==i){
System.out.println(+i"\t");
}
}
}
}
public class tiaojian{
public static void main(String[] args){
int i;
for(i=1;i<1000;i++){
if(i%3==0&&i%5==0&&i%7==0)
System.out.println("可以被3和5还有7整除的数为:"+i);
}
}
}
标签:
原文地址:http://www.cnblogs.com/hao520-/p/5336414.html