1035. Password

902 단어
#include<list>
#include<iostream>
#include<string>
using namespace std;
int main(){
  list<string>modi;
  int n;cin>>n;
  for(int i=0;i<n;++i){
    string name,code;  cin>>name>>code;
    bool modied=false;
    for(auto &x:code)
      switch(x){
       case '1':x='@';modied=true;break;
       case '0':x='%';modied=true;break;
       case 'O':x='o';modied=true;break;
       case 'l':x='L';modied=true;break; }
    if(modied)modi.push_back(name+' '+code);
  }
  if(modi.empty())
    cout<<"There is "<<n<<" account"<<(n==1?"":"s")<<" and no account is modified";
    else {
      cout<<modi.size()<<endl;
      for(auto&x:modi)cout<<x<<endl; }
}

좋은 웹페이지 즐겨찾기