fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i,ii,iii,iiii,iiiii,iiiiii,n,p = 0;
  5. for(i = 1;i <= 6;i++){
  6. for(ii = 1;ii <= 6;ii++){
  7. for(iii = 1;iii <= 6;iii++){
  8. for(iiii = 1;iiii <= 6;iiii++){
  9. for(iiiii = 1; iiiii <= 6;iiiii++){
  10. for(iiiiii = 1; iiiiii <= 6;iiiiii++){
  11. n = i * 100000 + ii * 10000 + iii * 1000 + iiii * 100 + iiiii * 10 + iiiiii * 1;
  12. if (n % 7 == 0 && n % 111111 != 0){
  13. p = p + 1;
  14. }
  15. }
  16. }
  17. }
  18. }
  19. }
  20. }
  21. printf("%d\n", p);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
6660