UVA 12289 - One-Two-Three

UVA Sep 1, 2020

Problem PDF

Solution:

# include 
# include 
# include 

int main()
{
   int n;
   char a[7],chr;
 scanf("%d%c",&n,&chr);
while(n--)
{

  gets(a);
  if(strlen(a)==5)
  printf("3\n");
  else if((a[0]=='o' && a[1]=='n')||
          (a[0]=='o' && a[1]=='e')||
          (a[1]=='n' && a[2]=='e')||
          (a[0]=='o' && a[2]=='e')||
          (a[0]=='o' && a[2]=='n'))
  printf("1\n");
  else
  printf("2\n");

}

    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12289/12289.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.