我的个人网站 Cheese的个人主页http://www.cheese.ren/
博客来源 http://blog.cheese.ren/43http://blog.cheese.ren/43
欢迎交换友链 :-)
#include <bits/stdc++.h>
using namespace std;
int main() {
int index[10];
while (scanf("%d", &index[0]) != EOF) {
for (int i=1; i<10; i++)
cin >> index[i];
//output the first position
for (int i=1; i<10; i++) {
if (index[i]) {
index[i]--;
printf("%d", i);
break;
}
}
//output the other position
for (int i=0; i<10; i++) {
while (index[i]) {
printf("%d", i);
index[i]--;
}
}
printf("\n");
}
return 0;
}