Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <time.h>
- #include <cstdlib>
- #include <string>
- #include <fstream>
- #define len1 5
- #define ull unsigned long long
- #define ush unsigned short
- #define ulg unsigned long
- using namespace std;
- ofstream fout("text.txt");
- int main()
- {
- ull x;
- cout<<"nr coduri:";cin>>x;
- srand(time(NULL));
- vector <char> alfa;
- for (char let='A';let<='Z';let++)
- alfa.push_back(let);
- for (char nr='0';nr<='9';nr++)
- alfa.push_back(nr);
- for (ulg c=0;c<x;c++)
- {
- for (ush i=0;i<len1;i++) {
- for (ush j=0;j<len1;j++)
- fout<<alfa.at(rand()%(alfa.size()));
- if (i!=4)
- fout<<'-';
- }
- fout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement