top1编程
← 返回题目
题解

【入门】大数的平方

1 条题解

  • 0
    @ 2026-7-29 0:16:14
    #include<iostream>
    using namespace std;
    
    // 函数用于计算平方
    int square(int num) {
        return num * num;
    }
    
    // 判断并输出较大数的平方
    int main() {
        int a, b;
        cin >> a >> b;
        cout << square(max(a, b));
        return 0;
    }
    
    • 1