UVA Problem 12289 ( One-Two-Three) Solution

Problem Solving, UVa

 

#include <bits/stdc++.h>

using namespace std;

int main()

{

    char s[101],l;

    int i,tc,ans;

    cin>>tc;

    while(tc--)

    {

        scanf("%s",s);

        l=strlen(s);

        if(l<=3)

        {

        if(s[0] =='o'&&s[1]=='n'&& s[2] == 'e' || s[0] == 'o' && s[1] == 'n' ||

        s[0] == 'o' && s[2] == 'e' ||s[1] == 'n' && s[2] == 'e')

        printf("1\n");

        else if(s[0] == 't' && s[1] == 'w' && s[2] == 'o'||s[0] == 't' && s[1] == 'w'

        ||s[0] == 't' && s[2] == 'o'||s[1] == 'w' && s[2] == 'o' )

         printf("2\n");

       

        }

        else

        cout<<"3"<<endl;

    }

    return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...