用除法判断质数
判断质数
题目:
给定 n 个正整数 ai,判定每个数是否是质数。
输入格式
第一行包含整数 n。
接下来 n 行,每行包含一个正整数 ai。
输出格式
共 n 行,其中第 i 行输出第 i 个正整数 ai 是否为质数,是则输出 Yes,否则输出 No。
数据范围
1≤n≤100,
1≤ai≤231−1
输入样例:
2
2
6
输出样例:
Yes
No
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm&g
原创
2021-09-15 13:31:32 ·
194 阅读 ·
0 评论