距离 CCF-CSP-J/S 第一轮的前一天晚上:
传送门
题意翻译
给定一个正整数 n 和 n 个字符,每个字符对应一种颜色,分别是:粉色
P
、白色W
、绿色G
、黄色Y
。请你统计出有多少颜色(重复则算 1 种),如果有 3 种,请输出Three
,否则输出Four
。
最普通的搜索题了:
看一个样例直接写题:
6
G W Y P Y W
Four
顺便写个提示:
对于第一个样例,共有:G,W,Y,P 的颜色不同
直接上代码:
#include<iostream>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
struct n{
char a;
}s[101];
int i,j,ans,n;
int main(){
cin>>n;
for(i=1;i<=n;i++){
cin>>s[i].a;
}
for