Zoj 2514 generate passwords

Source: Internet
Author: User
// The question is relatively simple. You can modify the password as required by the question. If the password has been modified, You can output it if it does not exist! # Include "iostream" # include "string" # include "map" # include "vector" using namespace STD; struct info {string name; string password ;}; int main () {int N, I, j, Count, Len; bool flag; Info info [1010]; Map <char, char> m; vector <info> V; vector <info>:: iterator it; m ['1'] = '@', M ['0'] = '%', M ['l'] = 'l ', M ['O'] = 'O'; while (CIN> N & N) {COUNT = 0; V. clear (); // This statement is missing, and the vector is not cleared. Wa once, careless! For (I = 0; I <n; I ++) CIN> info [I]. name> info [I]. password; for (I = 0; I <n; I ++) {Len = info [I]. password. length (); flag = false; For (j = 0; j <Len; j ++) {If (M [info [I]. password [J]) {info [I]. password [J] = m [info [I]. password [J]; flag = true ;}} if (FLAG) {count ++; V. push_back (info [I]) ;}} if (count) {cout <count <Endl; For (IT = v. begin (); it! = V. end (); It ++) cout <(* it ). name <"" <(* it ). password <Endl;} elsecout <"no account is modified. "<Endl ;}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.