超困😴
这题一点都不提神qaqaqaqaq
想要一张50元优惠券
puts()不用\n啦 (复制粘贴🐶的锅
1035题目链接
#include <stdio.h>
#include <string.h>
const int MAX_LEN = 11;
int main() {
char user[1000][MAX_LEN],pass[1000][MAX_LEN];
int no[1000];
int n, modified_n = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%s%s", user[i], pass[i]);
}
for (int j = 0; j < n; ++j) {
int l_ = strlen(pass[j]);
bool mod = false;
for (int i = 0; i < l_; ++i) {
switch (pass[j][i]) {
case '1':
pass[j][i] = '@';
mod = true,no[modified_n]=j;
break;
case '0':
pass[j][i] = '%';
mod = true,no[modified_n]=j;
break;
case 'l':
pass[j][i] = 'L';
mod = true,no[modified_n]=j;
break;
case 'O':
pass[j][i] = 'o';
mod = true,no[modified_n]=j;
break;
default:
break;
}
}
if (mod)modified_n++;
}
if(modified_n==0)
if(n!=1)
printf("There are %d accounts and no account is modified\n",n);
else puts("There is 1 account and no account is modified");
else{
printf("%d\n",modified_n);
for(int i=0;i<modified_n;i++){
printf("%s %s\n",user[no[i]],pass[no[i]]);
}
}
return 0;
}
网友评论