//特殊的数字四十 #include<stdio.h> int main(){ int i,sum,n; for(i=1000;i<10000;i++){ sum = 0; n = i; while(n>0){ sum += n%10; n /= 10; } if(sum == 10) printf("%d\n",i); } return 0; }
原文地址:https://www.cnblogs.com/Hqx-curiosity/p/12243276.html
时间: 2024-10-16 16:42:47