Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cstdlib>
- #include <ctime>
- #define MAX_REGIONS_COUNT 10
- #define MAX_RESULTS_COUNT 10
- int main(void)
- {
- FILE *File = fopen("F:/Folder/input.vgp", "ab");
- FILE* Input = 0;
- if (File)
- {
- std::srand(std::time(0));
- int RegionsCount = rand() % MAX_REGIONS_COUNT;
- int OutputSize = 0;
- int SeenAnswers = 0;
- for (int Region = 0; Region < RegionsCount; Region++)
- {
- int ResultsCount = rand() % MAX_RESULTS_COUNT;
- if (ResultsCount == 0)
- {
- ResultsCount = 1;
- }
- int Results[MAX_RESULTS_COUNT + 1];
- Results[0] = ResultsCount;
- for (int ResultIndex = 1; ResultIndex <= ResultsCount; ResultIndex++)
- {
- int Result = rand() % 150 + 150;
- Results[ResultIndex] = Result;
- }
- fwrite(Results, (ResultsCount + 1) * sizeof(int), 1, File);
- }
- if (!Input)
- {
- Input = fopen("F:/Folder/output.vgp", "r");
- }
- else
- {
- //fread(, , , Input);
- }
- fclose(File);
- }
- system("PAUSE");
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement