讨论 / acm新手,我的AC代码,欢迎交流
junior 2016-10-13 00:11:56
点我顶贴 收藏 删除
# include <iostream>

# include <cstdio>

# include <cstdlib>

# include <cstring>

# include <vector>

# include <algorithm>

using namespace std;

char s[12];

long long c[10] = {0};

int main()

{

long long a, b, i;

int j, len, temp;

scanf("%lld%lld",&a,&b);

for(i=a; i<=b; ++i)

{

sprintf(s, "%d", i);

len = strlen(s);

for(j=0; j<len; ++j)

{

temp = (int)s[j]-48;

++c[temp];

}

}

for(i=0; i<=9; ++i)

printf("%lld ",c[i]);

return 0;

}

查看更多回复
提交回复