1033. 旧键盘打字(20)

来源:互联网 发布:阿里云企业邮箱设置 编辑:程序博客网 时间:2024/05/16 02:32
#include<stdio.h>  #include<string.h>  char change(char c)  {      if(c>='A'&&c<='Z')          return c+('a'-'A');      else if(c>='a'&&c<='z')          return c+('A'-'a');      else          return c;  }    int main()  {      char in[100001],broken[100001],*pi,c;      int i;      i=0;      while((c=getchar())!='\n')      {          broken[i++]=c;      }      broken[i]='\0';      i=0;      while((c=getchar())!='\n')      {          in[i++]=c;      }      in[i]='\0';      for(i=0;broken[i]!='\0';i++)      {          if(broken[i]>='a'&&broken[i]<='z')              continue;          while((pi=strchr(in,broken[i]))!=NULL)          {              *pi=1;          }          if(broken[i]>='A'&&broken[i]<='Z')          {              while((pi=strchr(in,broken[i]+('a'-'A')))!=NULL)              {                  *pi=1;              }          }        }      if((pi=strchr(broken,'+'))!=NULL)      {          for(i=0;in[i]!='\0';i++)          {              if(in[i]>='A'&&in[i]<='Z')                  in[i]=1;          }      }      for(i=0;in[i]!='\0';i++)      {          if(in[i]>1)              printf("%c",in[i]);      }      printf("\n");      return 0;  } 

0 0
原创粉丝点击