杭电oj-1328

水题

#include<stdio.h>
#include<string>
int main()
{
    int n,len,times=0;
    char str[50];
    char str1[50];
    while(scanf("%d",&n)!=EOF)
    {
        getchar();
        while(n--)
        {
            times++;
            gets(str);
            len=strlen(str);
            for(int i=0;str[i]!='\0';i++)
            {
                if(str[i]=='Z')
                str1[i]='A';
                else
                str1[i]=str[i]+1;
            }
            printf("String #%d\n",times);
            for(int j=0;j<len;j++)
                printf("%c",str1[j]);
            printf("\n\n");
        }
}
return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_41048982/article/details/88778400