cswork / OA打开练习工作台

CiscoOA #7

Prime vs Composite

估计简单可在线判题

考点(AI 标注)位运算

Output Prime or Composite for each integer. A number that is at least 2 and has exactly two positive divisors, 1 and itself, is prime and outputs Prime; every other integer uses the original problem's output label for non-prime, uniformly Composite. Therefore 0, 1, and negative integers also output Composite.

输入格式

The first line contains N, and the second line contains N integers. The original gave no numeric bounds; this site uses 0≤N≤2000 and −2^31≤a[i]≤2^31−1. An empty list produces empty output text.

输出格式

Output Prime or Composite for each item, one per line; an empty list produces empty output text.

样例 1

输入:

5
541 37 113 5 10

输出:

Prime
Prime
Prime
Prime
Composite

样例 2

输入:

5
-1 0 1 2 4

输出:

Composite
Composite
Composite
Prime
Composite

样例 3

输入:

0

输出:

样例说明

The outputs of the three public examples are, in order: Prime / Prime / Prime / Prime / Composite; Composite / Composite / Composite / Prime / Composite; empty text. Verified by independent enumeration or direct simulation.