文章

32

粉丝

81

获赞

5

访问

16.3k

头像
密码翻译 题解:
P1179 北京大学/湖南大学机试题
发布于2023年8月29日 11:07
阅读数 507

数组定为100真的只能通过百分之30,要1000才可以。

#include<bits/stdc++.h>
using namespace std;

int main(){
char s[1000];
while(gets(s)){
    for(int i=0;i<strlen(s);i++){
    if((s[i]>='a'&&s[i]<='y')||(s[i]>='A'&&s[i]<='Y'))
            s[i]=s[i]+1;
    else if(s[i]=='z')
            s[i]='a';
    else if(s[i]=='Z')
            s[i]='A';
    }
    for(int i=0;i<strlen(s);i++){
        cout<<s[i];
    }
    cout<<endl;
}
return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发