Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
想知道为什么会CE。。。。求大神解答#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std; char*str = new char[100000001]; int main() { int a, b; while (cin >> a >> b&&!(a==0&&b==0)) { int sum[10]; for (int i = 0;i < 10;i++) sum[i] = 0; for (int i = a;i <= b;i++) { itoa(i, str, 10); for (int t = 0;t < strlen(str);t++) sum[str[t]-'0']++; } cout << sum[0]; for (int k = 1;k < 10;k++) cout << " " << sum[k]; cout << endl; } delete[] str; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator