fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a,b,c,d,e,i,count;
  6. count=0;
  7. for(i=1;i<=10000;i++){
  8. a=i/10000;//10000の位
  9. b=i/1000%10;//1000の位
  10. c=i/100%10;//100の位
  11. d=i/10%10;//10の位
  12. e=i%10;//1の位
  13. if((a+b+c+d+e)%7==3)count++;
  14. }
  15. printf("%d",count);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
1433