3 条题解

  • 0
    @ 2026-3-29 16:46:02

    其实,只需要输出 0 就行了。

    AC Code:

    #include <bits/stdc++.h>
    using namespace std;
    
    int main() {
    	freopen("pow.in", "r", stdin);
        freopen("pow.out", "w", stdout);
    	int n;
    	cin >> n;
    	cout << 1;
    	for (int i = 1; i <= n; i++) {
    		cout << 0;
    	}
    	return 0;
    }
    
    • 0
      @ 2026-3-20 20:11:43

      这道题非常简单,具体用到了一个小小的技巧,对于 10n10^n 而言,nn 等于几就等于它后面有几个 00,因此可得代码:

      #include <bits/stdc++.h>
      using namespace std;
      int a,b,ans;
      int main(){
      	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
      	freopen("pow.in", "r", stdin);
      	freopen("pow.out","w",stdout);
      	cin >> a;
      	cout << "1";
      	for (int i = 1;i <= a;++i) cout << "0";
      	return 0;
      }
      
      • 0
        @ 2025-9-5 21:53:26

        简单题。

        由于以 1010 为底数,所以直接在后面加 00 即可。(并且不用考虑大数据问题)

        代码如下:

        // P3. [System Test] Powers of 10
        // code by:cirrationaler
        // time:2025/08/21
        #include <bits/stdc++.h>
        
        using namespace std;
        
        int n;
        
        int main()
        {
            // freopen("code.in", "r", stdin);
            freopen("pow.in", "r", stdin);
            freopen("pow.out", "w", stdout);
            scanf("%d", &n);
            printf("1");
            for (int i = 1; i <= n; i++)
            {
                printf("0");
            }
            printf("\n");
            return 0;
        }
        
        
        • 1

        信息

        ID
        3
        时间
        1000ms
        内存
        512MiB
        难度
        2
        标签
        递交数
        75
        已通过
        25
        上传者