From 6f7d2d609fbc1190d113d41a7b5f0e3e315953b2 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Thu, 21 Jul 2016 10:15:13 +0800 Subject: [PATCH] Create 1584.cpp --- QUSTOJ/1584.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 QUSTOJ/1584.cpp diff --git a/QUSTOJ/1584.cpp b/QUSTOJ/1584.cpp new file mode 100644 index 0000000..b222ab6 --- /dev/null +++ b/QUSTOJ/1584.cpp @@ -0,0 +1,20 @@ +#include +#include +int main() +{ + int m,i,k,pc; + scanf("%d",&pc); + for(;pc>0;pc--) + { + scanf("%d",&m); + k=(int)sqrt(m); + for(i=2;i<=k;i++) + if(m%i==0) + break; + if(i>k) + printf("Yes\n"); + else + printf("No\n"); + } + return 0; +}