(以“分类:简单数学问题 ==摘要== {{信息题|素数判定|http://www.wikioi.com/problem/1430/|1|100}} ==题意== 素数判定。 ==题解== 枚举2~根号n...”为内容创建页面) |
小 (代码字符错误) |
||
| 第19行: | 第19行: | ||
} | } | ||
} | } | ||
| − | printf("\\ | + | printf("\\t"); |
return 0; | return 0; | ||
} | } | ||
</pre> | </pre> | ||
|code1430}} | |code1430}} | ||
| − | |||
| − | |||
| 题目链接 | 难度等级 | 完成状态 | 完成分数 | 最后编辑时间 | 需要注意 |
|---|---|---|---|---|---|
| 素数判定 | ★☆☆☆☆ | 答案正确 | 100 | {{{time}}} | 无 |
素数判定。
枚举2~根号n,看是否有因子。
| 1430.cpp代码已折叠
展开折叠内容
|
|---|
#include<cstdio>
int main(){
int u;
scanf("%d",&u);
for(int i=2;i*i<=u;++i){
if(u%i==0){
printf("\\n");
return 0;
}
}
printf("\\t");
return 0;
}
|