Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include <stdlib.h>
- // This rand() function is not a good random number generator(People say so)
- /*
- int rand(int l, int r){
- static std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
- std::uniform_int_distribution<int> uid(l, r); return uid(rng);
- }*/
- signed main() {
- FILE *fptr = fopen("in", "w");
- int t = 1, n;
- // fprintf(fptr, "%d\n", t);
- for(int i = 0; i < t; ++i) {
- n = rand() % 100 + 1;
- if(i == 0) {
- fprintf(fptr, "%d\n", n);
- }
- else
- fprintf(fptr, "\n%d\n", n);
- while(n--)
- fprintf(fptr, "%d ", rand() % 100);
- }
- fclose(fptr);
- }
Add Comment
Please, Sign In to add comment