#include
{
int i,s=0;for(i=1;i<=100;i++){if(i%3==0)continue;s+=i;}printf("%d\n",s);return 0;}
#include
{
int x,sum = 0;
for (x=1;x<=100;x++)
{
if (x%3!=0)
{
sum +=x;
}
}
printf("sum = %d\n",sum);
return 0;
}//给你个参考
#include
#include
{
int i,s=0;
for(i=1;i<=100;i++)
{
if(i%3==0)
{
continue;
}
s+=i;
}
printf("%d\n",s);
system("pause");
return 0;
}
int sum=0;for(int i=0;i<100;i++){if(i/3==0){
sum = sum + i;
}else
{
continue;}}
Console.WriteLine("1到100内不能被3整除的数的和:{0}",sum);
Console.ReadLine();
int sum=0;for(int i =1;i<100;i++){if(i%3!=0){sum+=i;}else{continue;}}