No older revisions available
No older revisions available
코드 ¶
~cpp
#include <iostream>
using namespace std;
#include <fstream>
#include <cstdlib>
#include <ctime>
ofstream fout("test.txt");
int main()
{
srand(time(NULL));
int numCase;
cout << "Case의 수를 입력 :\n";
cin >> numCase;
fout << numCase << endl;
int alph, priority, temp;
char c;
for (int i = 1; i <= numCase; i++)
{
alph = rand() % 1000;
priority = rand() % 1000;
while (alph != 0)
{
temp = alph % 26;
c = 'a' + temp;
alph /= 26;
fout << c;
}
fout << " " << priority << " ";
if (i % 10 == 0)
fout << endl;
}
return 0;
}