fork download
  1. #include <stdio.h>
  2. int main() {
  3. //ここを作成
  4. int a,b,c,d,e,count;
  5. count=0;
  6. a=100;
  7. while(a<=1000){
  8. b=a/100;
  9. c=a%100/10;
  10. d=a%100%10;
  11. e=b+c+d;
  12. if(e%7==0){
  13. count++;
  14.  
  15. }a++;
  16.  
  17. }
  18. printf("各位の値の合計値が7の倍数になる整数は%dである",count);
  19.  
  20.  
  21. return 0;
  22.  
  23. }
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
各位の値の合計値が7の倍数になる整数は126である