fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int a;
  5. int n;
  6. a=0;
  7. n=1;
  8. while(n<=100)
  9. {
  10. if (n%3==0 || n%5==0)
  11. {
  12. n=n+1;
  13. }
  14. else
  15. {
  16. a=a+n;
  17. n=n+1;
  18. }
  19. }
  20. printf("求める値は%dです\n",a);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
求める値は2632です