fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int n = 1;
  5. int t = 0;
  6.  
  7. while (n <= 100){
  8. if (n % 3 != 0 && n % 5 != 0){
  9. t = t + n;
  10. }
  11. n = n + 1;
  12. }
  13.  
  14. printf("3の倍数でも5の倍数でもない数の合計は%d\n", t);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
3の倍数でも5の倍数でもない数の合計は2632