Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <ctime>
- using namespace std;
- int main()
- {
- tryAgain:
- srand(time(NULL));
- setlocale(LC_ALL, "ru");
- bool alreadyThere;
- int randNumber, quantity, selection;
- int fourNull = 0000;
- cout << "Выберите тип генерации" << endl
- << "1.Упорядоченный" << endl
- << "2.Рандомный" << endl;
- cin >> selection;
- switch (selection)
- {
- case 1:
- cout << "Выберите количество генерируемых номеров" << endl;
- cin >> quantity;
- alreadyThere = false;
- while (fourNull <= quantity)
- {
- fourNull++;
- cout << "+7910000" << setw(4) << setfill('0') << fourNull << "tt";
- }
- goto tryAgain;
- break;
- case 2:
- cout << "Выберите количество генерируемых номеров" << endl;
- cin >> quantity;
- for (int i = 0; i <= quantity; i++)
- {
- randNumber = rand() %9999 + fourNull;
- cout << "+7910000" << setw(4) << setfill('0') << randNumber << "tt";
- }
- goto tryAgain;
- break;
- default:
- goto tryAgain;
- break;
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment