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