1059 C语言竞赛 (20 分)

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int arr[ << ];
int sushu(int t) {
for (int i = ; i <= sqrt(t); i++) {
if (t % i == )
return ;
}
return ;
}
int main() {
int n, m, x, y;
cin >> n;
for (int i = ; i <= n; i++) {
cin >> x;
arr[x] = i;
}
cin >> m;
while (m--) {
cin >> y;
if (arr[y] == -) { // 奖品领过的不用标记
cout << setw() << setfill('') << y << ": " << "Checked" << endl;
continue;
}
if (arr[y] == ) {
cout << setw() << setfill('') << y << ": " << "Mystery Award" << endl;
arr[y] = -;
continue;
}
if (arr[y] == ) { // 不在名单的不用标记
cout << setw() << setfill('') << y << ": " << "Are you kidding?" << endl;
continue;
}
if (sushu(arr[y]) == ) {
cout << setw() << setfill('') << y << ": " << "Minion" << endl;
arr[y] = -;
continue;
}
cout << setw() << setfill('') << y << ": " << "Chocolate" << endl;
arr[y] = -;
}
return ;
}
上一篇:做个这样的APP要多久?[转]


下一篇:sql server 老外博客