c语言输入一个整数,判断其是否为另一个数的平方数 用顺序结构
时间: 2024-05-29 16:08:22 浏览: 159
#include <stdio.h>
int main() {
int num, i;
printf("请输入一个整数:");
scanf("%d", &num);
for (i = 1; i * i <= num; i++) {
if (i * i == num) {
printf("%d是一个数的平方数,它是%d的平方\n", num, i);
return 0;
}
}
printf("%d不是任何一个数的平方数\n", num);
return 0;
}
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241231045021.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![application/octet-stream](https://img-home.csdnimg.cn/images/20210720083646.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)