fork(1) download
  1. #include <stdio.h>
  2. int main(){
  3. int a=1;
  4. // int b;
  5. int sum=0;
  6.  
  7. while(a!=100){
  8. if(a%3==0||a%5==0)
  9. {a=a+1;}
  10. else
  11. {sum=sum+a;
  12. a=a+1;}
  13. }
  14. printf("合計は%dです。\n",sum);
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
合計は2632です。