View Code of Problem 121

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <stack>
#include <map>
#include <set>
#include <queue>
using namespace std;
int change(int a,int b,int c)
{
    return a*3600+b*60+c;
}

int main()
    {
        #ifdef  ONLINE_JUDGE
        #else
        freopen("1.txt","r",stdin);
        #endif
        string str;
        while(getline(cin,str))
        {
            int len=str.size();
            string temp;
            int i=0;
            while(1)
            {
                if(i>len) break;
                temp="";
                while(i<len&&str[i]!=' ')
                {
                    temp+=str[i];
                    i++;
                }

                    if(temp=="occupation") cout<<"OH-OH-OH-QQ-PEI-PEI-SHION";
                    if(temp=="occupation.") cout<<"OH-OH-OH-QQ-PEI-PEI-SHION.";
                    else cout<<temp;
                    cout<<" ";
                    i++;
            }
            cout<<endl;
        }


    }

Double click to view unformatted code.


Back to problem 121