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