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