forked from njones93531/4620Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintToString.cpp
More file actions
39 lines (36 loc) · 1.13 KB
/
intToString.cpp
File metadata and controls
39 lines (36 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <string>
using namespace std;
string toStr(int n, int base) {
string convertString = "abcdefghijklmnopqrstuvwxyz";
if (n < base) {
return string(1, convertString[n]);
} else {
cout << "Mod" << n % base << endl;
string x = "0";
return toStr(n/base, base) + convertString[n%base];
}
}
int main() {
string pwd0, pwd1, pwd2, pwd3, pwd4, pwd5, pwd;
for(long long i = 0; i < 26; i++){ //If we try long enough, give up
pwd0=toStr(i, 26);
for(long long j = 0; j < 26; j++){
pwd1=toStr(j, 26);
for(long long k = 0; k < 26; k++){
pwd2=toStr(k, 26);
for(long long l = 0; l < 26; l++){
pwd3=toStr(l, 26);
for(long long m = 0; m < 26; m++){
pwd4=toStr(m, 26);
for(long long n = 0; n < 26; n++){
pwd5=toStr(n, 26);
}
}
}
}
}
pwd = pwd0 + pwd1 + pwd2 + pwd3 + pwd4 + pwd5;
}
cout << pwd << endl;
}