View Code of Problem 121

#include<cstdio>  
#include<cstring>  
char s[100][100],ch;  
int main()  
{  
    int x=0,y=0,i;  
    while(scanf("%c",&ch) && ch!='\n')  
    {  
        if(ch==' ') y=0,x++;  
        else s[x][y++]=ch;  
    }  
    char a[100]="occupation";  
    char b[100]="OH-OH-OH-QQ-PEI-PEI-SHION";
    for( i=0;i<=x;i++)  
        if(strcmp(s[i],a)==0) strcpy(s[i],b);  
    for( i=0;i<=x;i++)  {
        if(i==0)printf("%s",s[i]);  
	    else
			printf(" %s",s[i]);
    }
    return 0;  
}

/*
Main.c:1:19: fatal error: cstdio: No such file or directory
 #include<cstdio>  
                   ^
compilation terminated.
*/

Double click to view unformatted code.


Back to problem 121