8 条题解
-
6
正常解法:
#include<bits/stdc++.h> using namespace std; int main() { int x=30; while(++x) { if(x*x/1000==x*x/100%10&&x*x/10%10==x*x%10&&x*x/1000!=x*x%10) { cout<<x*x; break; } } return 0; }
逃课:
#include <bits/stdc++.h> using namespace std; int main() { cout<<7744; return 0; }
-
0
#include<bits/stdc++.h> using namespace std; /* 思路:遍历i范围的4位整数,i满足3个条件,分别判断 */ int main() { int i; //循环范围在4位数以内 for(i = 1000; i <= 9999; i++){ //前两位数字时相同的,后两位数字时相同的 if(i/1000 == i/100%10 && i%100/10 == i%10){ //四位的车号刚好是一个整数的平方 if(sqrt(i) == int(sqrt(i))){ cout << i << endl; } } } return 0; }
- 1
信息
- ID
- 253
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 2
- 标签
- 递交数
- 162
- 已通过
- 105
- 上传者