PAT basic 1023

来源:互联网 发布:小米note3卸载软件 编辑:程序博客网 时间:2024/06/11 21:47
#include <iostream>using namespace std;int main() {    int a[10];    for (int i = 0; i < 10; i++) {        cin >> a[i];    }    int t;    for (int i = 1; i < 10; i++) {        if (a[i] != 0) {            cout << i;            t = i;            break;        }    }    for (int i = 0; i < a[0]; i++) {        cout << 0;    }    for (int i = 0; i < a[t] - 1; i++) {        cout << t;    }    for (int i = t + 1; i < 10; i++) {        for (int k = 0; k < a[i]; k++) {            cout << i;        }    }    return 0;}
原创粉丝点击