【(DIV定格2)教育Codeforcesラウンド81 A】数を表示します

トピックリンク

[説明]


1.をこすりへの優先スティックと2
それが奇数であれば、余分な3始まる港で7にして、

[コード]

#include <bits/stdc++.h>
using namespace std;



int main(){
    #ifdef LOCAL_DEFINE
        freopen("E:\\rush.txt","r",stdin);
    #endif // LOCAL_DEFINE
    ios::sync_with_stdio(0),cin.tie(0);
    int T;
    cin >> T;
    while (T--){
        int n;
        cin >> n;
        if (n&1){
            cout<<7;
            n-=3;
        }
        for (int i = 1;i <= n/2;i++) cout<<1;
        cout<<endl;
    }
    return 0;
}

おすすめ

転載: www.cnblogs.com/AWCXV/p/12242089.html