3 条题解

  • 1
    @ 2023-10-5 16:15:10

    为啥我的代码这么短???

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;
        cin >> n;
        for(int i=1;i<=n;i++)
        {
            int x;
            cin >> x;
            cout << i << ":";
            for(int j = 1; j <= x; j++)
                cout << "*";
            cout << endl;
        }
    }
    
    • 0
      @ 2023-2-9 20:26:30

      7星???

      #include <iostream>//acBob(8520576)
      using namespace std;
      int main()
      {
          int n, a[105];
          cin >> n;
          for (int i = 1; i <= n; i++)
          {
               cin >> a[i];
          }
          for (int i = 1; i <= n; i++)
         {
               cout << i << ":";
              for (int j = 1; j <= a[i]; j++)
              {
                   cout << "*";
              }
              cout << endl;
          }
          return 0;
      }
      
      
      
      • 0
        @ 2023-1-20 20:07:24
        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
            int n;
            int a[1023];
            cin >> n;
            for(int i=1;i<=n;i++)
            {
                cin >> a[i];
            }
            for(int i=1;i<=n;i++)
            {
                cout << i << ":";
                for(int j=1;j<=a[i];j++)
                {
                    cout << "*";
                }
                cout << endl;
            }
        }
        
        • 1

        信息

        ID
        325
        时间
        1000ms
        内存
        16MiB
        难度
        1
        标签
        递交数
        50
        已通过
        34
        上传者