PTA 乙级 1023 组个最小数 (20分)
时间:2020-07-10 09:25:45
收藏:0
阅读:45
水水水!
1 #include <iostream> 2 using namespace std; 3 4 int main() { 5 int a[10] = { 0 }; 6 for (int i = 0; i < 10; i++)cin >> a[i]; 7 //输出第一个数 8 for (int i = 0; i < 10; i++) { 9 if (a[i] != 0 && i != 0) { 10 cout << i; 11 a[i]--; 12 break; 13 } 14 } 15 for (int i = 0; i < 10; i++) { 16 while (a[i] != 0) { 17 cout << i; 18 a[i]--; 19 } 20 } 21 return 0; 22 }
评论(0)