摘要: http://acm.timus.ru/problem.aspx?space=1&num=1353题意:输入一个s,求从1-10^9的数中各位数字之和是s的个数;思路:采用一个0-81的数组记录和为i的个数,然后对每一位都从0-9进行遍历;View Code #include<cstdio>using namespace std;int main(){ int ans[100],temp[100],n,i,j,k; for(i=0;i<100;i++) ans[i]=temp[i]=0; scanf("%d",&n); if(n==1) p 阅读全文
posted @ 2011-12-10 09:50 LT-blogs 阅读(273) 评论(0) 推荐(0) 编辑