首页 > 学院 > 开发设计 > 正文

PAT 1035

2019-11-08 02:45:48
字体:
来源:转载
供稿:网友
#include<cstdio>#include<algorithm>#include<stdlib.h>#include<cstring>#include<math.h>struct pnode{	char name[20];	char pw[20];	bool ischange;}temp[1010];int main(){	int n,k=0;	int len;	scanf("%d",&n);	for(int i=0;i<n;i++)	{		scanf("%s %s",temp[i].name,temp[i].pw);			len=strlen(temp[i].pw);		temp[i].ischange=false;		for(int j=0;j<len;j++)		{			if(temp[i].pw[j]=='1')			{				temp[i].pw[j]='@';				temp[i].ischange=true;			}			else					if(temp[i].pw[j]=='l')				{					temp[i].pw[j]='L';					temp[i].ischange=true;				}			else					if(temp[i].pw[j]=='0')				{					temp[i].pw[j]='%';					temp[i].ischange=true;				}			else					if(temp[i].pw[j]=='O')				{					temp[i].pw[j]='o';					temp[i].ischange=true;				}						}		  if(temp[i].ischange)				k++;	}	if(k!=0)	{		PRintf("%d/n",k);		for(int i=0;i<n;i++)		{			if(temp[i].ischange==true)				printf("%s %s/n",temp[i].name,temp[i].pw);		}	}	else if(n==1&&k==0)		printf("There is %d account and no account is modified",n);	else		printf("There are %d accounts and no account is modified",n);		system("pause");	return 0;}
上一篇:通读cheerio API

下一篇:位运算的威力

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表