Skip to content

Instantly share code, notes, and snippets.

@hasanparasteh
Created March 13, 2019 23:13
Show Gist options
  • Save hasanparasteh/6d7790f6625b1559c44863d425c1cb4c to your computer and use it in GitHub Desktop.
Save hasanparasteh/6d7790f6625b1559c44863d425c1cb4c to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(int argc, char const *argv[])
{
//Enter your local codes here
//If you want just a local number then remove [] and {} and just enter your local code in ""
string local_code[] = {"0912", "0935", "0936", "0937", "0938", "0939"};
//A string to store numbers
string mobile_number;
//Create File to store numbers in text
fstream file;
file.open("Numbers.txt", fstream::out);
//Starting point of our numbers
int rand_number = 1111111;
while(rand_number != 9999999){
//write every local code into a file
for(int i=0;i<6;i++){
mobile_number = local_code[i] + to_string(rand_number);
file << mobile_number << "\n";
}
//add + to the starting point and run for loop again
rand_number++;
}
//close the file
file.close();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment