Advertisement
Spocoman

07. Safe Passwords Generator

Sep 12th, 2023
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.    
  7.     int a, b, passCount;
  8.     cin >> a >> b >> passCount;
  9.  
  10.     int charA = 35;
  11.     int charB = 64;
  12.  
  13.     for (int j = 1; j <= a; j++) {
  14.         for (int x = 1; x <= b; x++) {
  15.             if (charA == 56) {
  16.                 charA = 35;
  17.             }
  18.             if (charB == 97) {
  19.                 charB = 64;
  20.             }
  21.             cout << (char)charA << (char)charB << j << x << (char)charB << (char)charA << "|";
  22.             passCount--;
  23.             charA++;
  24.             charB++;
  25.  
  26.             if (passCount == 0)
  27.             {
  28.                 break;
  29.             }
  30.         }
  31.         if (passCount == 0)
  32.         {
  33.             break;
  34.         }
  35.     }
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement