코드

~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;
}
Retrieved from http://wiki.zeropage.org/wiki.php/알고리즘8주숙제/test
last modified 2021-02-07 05:30:21