package HelloWord;
public class HelloWord {
public static void main(String[] args) {
// TODO Auto-generated method stub
int i;
int sum=0;
for(i=1;i<=100;i++);
{
if (i%3==0) {
sum=sum+i;
}
System.out.println("100之内能被3整除的所有数之和为:"+sum);
相关分类