The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
7 Digit Phone Number Code
Posted by: 7 Digit Phone Number Code | September 28, 2010 @ 11:03pm
C++ Code
[
Download
]
#include <iostream> #include <fstream> #include <string> using namespace std; char iToA(int toCon) { char alpha[] = {'0','1','2','3','4','5','6','7','8','9'}; return alpha[toCon]; } int main() { string current; ofstream fout("dictionaryList.txt"); for(int a = 1; a < 10; a++) { current.clear(); current += iToA(a); for(int b = 0; b < 10; b++) { current.resize(1); current += iToA(b); for(int c = 0; c < 10; c++) { current.resize(2); current += iToA(c); for(int d = 0; d < 10; d++) { current.resize(3); current += iToA(d); for(int e = 0; e < 10; e++) { current.resize(4); current += iToA(e); for(int f = 0; f < 10; f++) { current.resize(5); current += iToA(f); for(int g = 0; g < 10; g++) { cout << current + iToA(g) << endl; } } } } } } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
Most basic way to do it.
Rating
4.36 / 8
67 Votes
http://codebin.yi.org/868
page generated in 0.01 seconds