fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a,b;
  5. a=0;
  6. b=1;
  7. while(b<=100){
  8. if (b%3!=0&&b%5!=0&&b%10>=6){
  9. a=a+b;
  10. }
  11. b=b+1;
  12. }
  13. printf("1から100のうち、条件を満たす数字の和:%d\n",b);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
1から100のうち、条件を満たす数字の和:101