69,371
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
char Team[20],PIN[20],store[20][40];
int n,N,flag,i,j,k;
int len1,len2;
while(scanf("%d",&n)!=EOF){
N=0;
for(i=0;i<n;i++){
flag=0;
scanf("%s%s",&Team,&PIN);
len1=strlen(Team);
len2=strlen(PIN);
for(j=0;j<len2;j++){
if(PIN[j]=='0'){
PIN[j]='%';
flag=1;}
else if(PIN[j]=='1'){
PIN[k]='@';
flag=1;}
else if(PIN[j]=='o'){
PIN[k]='O';
flag=1;}
else if(PIN[j]=='l'){
PIN[j]='L';
flag=1;}
}
if(flag==1){
for(k=0;k<len1;k++) store[N][k]=Team[k];
store[N][k]=' ';
for(k=0;k<len2;k++) store[N][k+len1]=PIN[k];
store[N][len1+len2]='\n';
N++;
}
}
if(N==0)printf("There is %d account and no account is modified\n",n);
else {
printf("%d\n",N+1);
for(i=0;i<=N;i++){
for(j=0;j<len1+len2+1;j++){
printf("%c",store[i][j]);
}
printf("\n");
}
}
}
return 0;
}
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
char Team[20],PIN[20],store[20][40];
int n,N,flag,i,j,k;
int len1,len2;
while(scanf("%d",&n)!=EOF){
N=0;
for(i=0;i<n;i++){
flag=0;
scanf("%s%s",&Team,&PIN);
len1=strlen(Team);
len2=strlen(PIN);
for(j=0;j<len2;j++){
if(PIN[j]=='0'){
PIN[j]='%';
flag=1;}
else if(PIN[j]=='1'){
PIN[j]='@';
flag=1;}
else if(PIN[j]=='o'){
PIN[j]='O';
flag=1;}
else if(PIN[j]=='l'){
PIN[j]='L';
flag=1;}
}
if(flag==1){
for(k=0;k<len1;k++) store[N][k]=Team[k];
store[N][k]=' ';
for(k=0;k<len2;k++) store[N][k+len1]=PIN[k];
store[N][len1+len2]='\n';
N++;
}
}
if(N==0)printf("There is %d account and no account is modified\n",n);
else {
printf("%d\n",N);
for(i=0;i<N;i++){
for(j=0;j<len1+len2+1;j++){
printf("%c",store[i][j]);
}
printf("\n");
}
}
}
return 0;
}