fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int s,n,x;
  6.  
  7. s=0;n=0;x=0;
  8.  
  9. do {
  10.  
  11. n+=1;
  12.  
  13. if(n%3==0) {
  14.  
  15. x+=1;
  16.  
  17. s+=n;
  18.  
  19. }
  20.  
  21. } while (n<100);
  22.  
  23. printf("3の倍数の個数=%d\n",x);
  24.  
  25. printf("3の倍数の合計=%\n",s);
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 4508KB
stdin
Standard input is empty
stdout
3の倍数の個数=33
3の倍数の合計=%