fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=100;
  5. int b,c,d;
  6. int count=0;
  7. while(a<1000){
  8. b=a/100;
  9. c=(a/10)%10;
  10. d=a%10;
  11. if((b+c+d)%7==0){
  12. count++;
  13. }
  14. a++;
  15. }
  16. printf("%d",count);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
126