fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int n = 100;
  6. int i = 0;
  7.  
  8. while (n <= 999)
  9. {
  10. int sum = n/100 + (n/10)%10 + n%10;
  11.  
  12. if (sum % 7 == 0)
  13. {
  14. i++;
  15. }
  16. n++;
  17. }
  18.  
  19. printf("%d\n", i);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
126