Problem Name: One-Two-Three
Author’s Name: By Rujia Liu China
Timelimit: 1
Problem Category: AD-HOC
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1332
Solution:
#include<cstdio>#include<cstring>
using namespace std;
int main()
{
int n;
char s[6];
scanf("%d",&n);
while(n--){
scanf("%s",&s);
if(strlen(s)==5)
{
printf("3n");
}else if((s[0]=='t' && s[1]=='w')||(s[0]=='t'&&s[2]=='o')||(s[1]=='w'&&s[2]=='o')){
printf("2n");
}
else
printf("1n");
}
return 0;
}
No comments:
Post a Comment
Thanks..