← 查看本卷题目
组合题5 个小题
已作答 0 / 5

(判断平方数) 问题:给定一个正整数 nn,希望判断这个数是否为完全平方数,即存在一个正整数 xx,使得 xx 的平方为 nn。

试补全程序。

#include<iostream>#include<vector>using namespace std; bool isSquare(int num) {    int i = ___①___;    int bound = ___②___;    for (; i <= bound; ++i) {        if (___③___) {            return ___④___;        }    }    return___⑤___;} int main() {    int n;    cin >> n;    if (isSquare(n)) {        cout << n << " is a square number" << endl;    } else {        cout << n << " is not a square number" << endl;    }    return 0;}
第 34 题单选题原卷 3 分

② 处应填( )

填写答案