题解 | #兔子的序列#
兔子的序列
https://www.nowcoder.com/practice/55fc2ebad3fd444bbb1754ba1b259762
#include <stdio.h> int main() { // 读取用户输入的整数的个数 int count = 0; // 存储用户输入的数据 int num = 0; while (1 == scanf("%d", &count)) { int max = 0; for (int i = 0; i < count; i++) { int flag = 1; scanf("%d",&num); for (int mul = 1; mul < num; mul++) { if ((mul * mul) == num) { flag = 0; break; } } if (flag) { // 获取最大值 max = max > num ? max : num; } } printf("%d\n", max); } return 0; }