社区讨论
全WA了
P10720[GESP202406 五级] 小杨的幸运数字参与者 2已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @mj2x7obd
- 此快照首次捕获于
- 2025/12/12 21:46 2 个月前
- 此快照最后确认于
- 2025/12/14 15:40 2 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,temp;
cin>>n;
while(n--){
cin>>temp;
int ans=0,d=temp;
for(int i=2;i*i<=d;i++){
if(temp%i==0){
ans++;
while(temp%i==0){
temp/=i;
}
}
}
if(temp>0) ans++;
if(ans==2) cout<<"1\n";
else cout<<"0\n";
}
return 0;
}
感觉和题解的大佬代码差不多,为啥全WA了???
回复
共 2 条回复,欢迎继续交流。
正在加载回复...