1、10.求11000之间可以同时被3,5,7整出的数字。public class ZhengChu public static void main (String args) int sum = 0; for (int a=1;a=1000 ;a+ ) if(a%3=0 & a%5=0 & a%7=0) sum+=a; System.out.println(11000之间能够同时被3、5、7整除的数字为: + sum); 运行结果:11.编程求1!+2!+3!+20!的值。public class Jiecheng public static void main(String args) int
2、 i,j; long sum=0;int t=1;for(i=1;i=20;i+)long m=1;for(j=1;j=i;j+)m=m*j;sum=sum+m;System.out.println(+sum);运行结果:12.给出一个学生的成绩输出该学生的成绩等级,90以上为优秀,80-89良好,70-79中等,60-69及格,60以下不及格,用if和switch语句分别实现。(1)#includevoid main()int score,i;printf(Enter the Students Score:n); scanf(%d,&score);i= score/10; switch( i
3、 ) case 10: case 9: printf(优秀n); break; case 8: printf(良好n); break; case 7: printf(中等n); break; case 6: printf(及格n); break; default:printf(不及格n); (2)#includevoid main()int score;printf(enter the students score:n); scanf(%d,&score);if(score=90) printf(优秀n);else if(score=80) printf(良好n);else if(score=70) printf(中等n);else if(score=60) printf(及格n);else printf(不及格n); 运行结果:85良好