Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
素数
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 495, Accepted users: 470
Problem 10464 : No special judgement
Problem description
  素数是只能被1和自己整除的整数。例如2,3,5和7是素数,4,6,8,9不是素数。编写一个函数,确定一个数是否是素数。

Input
  第一行一个正整数T,表示有T组测试数据。以下有T行,每行有一个正整数n(n<10000)

Output
  共T行,每行是01, 对于输入的每个正整数,判断其是否为素数,若为素数,打印1, 否则打印0

Sample Input
3
2
7
9
Sample Output
1
1
0
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2355 today,16259082 total, since 2010-05-07