fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int X,a,b,c,n;
  5. n=0;
  6. X=1;
  7. while(X<=100)
  8. {
  9. a=X/100;
  10. b=X%100/10;
  11. c=X%100%10;
  12. if((a+b+c)%3!=0)
  13. {
  14. if(!(c==0||c==5))
  15. {
  16. if(c>=6)
  17. {
  18. n+=X;
  19. }
  20. }
  21. }
  22. X++;
  23. }
  24.  
  25. printf("1の位が6以上のものの和:%d",n);
  26.  
  27. return 0;
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
1の位が6以上のものの和:1365