题目链接

【题解】

优先用2个棒子来凑1. 如果为奇数的话,多出来一根用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;
}

相关文章:

  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2023-02-17
  • 2023-01-25
  • 2023-01-09
  • 2022-12-23
  • 2021-05-25
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案