fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a=1,b=0;
  6. while(a<=100)
  7. {
  8. a=a+1;
  9. if(a%3!=0 && a%5!=0 && a%10==6)
  10. b=b+a;
  11. }
  12.  
  13.  
  14. printf("1から100のうち,3の倍数でもなく, 5の倍数でもない数字の中で,1の位の数字が6以上のものの和は%d",b);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
1から100のうち,3の倍数でもなく, 5の倍数でもない数字の中で,1の位の数字が6以上のものの和は306