fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i,ii,iii,iiii,iiiii,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. n = i * 10000 + ii * 1000 + iii * 100 + iiii * 10 + iiiii * 1;
  11. if (n % 7 == 0){
  12. p = p + 1;
  13. }
  14. }
  15. }
  16. }
  17. }
  18. }
  19. printf("%d\n", p);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
1110