From 6e014ca5ce263e96549236b5bf4f2379467b9e2b Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 27 Sep 2021 13:13:17 +0300 Subject: setting up git on old project --- make_heavy.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 make_heavy.c (limited to 'make_heavy.c') diff --git a/make_heavy.c b/make_heavy.c new file mode 100644 index 0000000..6961a31 --- /dev/null +++ b/make_heavy.c @@ -0,0 +1,63 @@ +#include +#include +#include +#define MAX_DIGITS 3000 +#define MIN_DIGITS 100 +#define VARIATION 100 + + +int main() +{ + + size_t size; + size_t i,j; + size_t sz; + size_t heavy_line; + char *number;//we don't want a stack overflow so it goes on the heap + + + scanf("%zu",&size); + scanf("%zu",&heavy_line); + + + number = malloc(sizeof(char)*(MAX_DIGITS+10+VARIATION)); + if(number==NULL)return -1; + srand(time(NULL)); + printf("%zu\n",size); + + for(i=0;i0 ;number[sz]=rand()%10+'0',--sz); + number[0]=rand()%9 + '1'; + printf("%s ",number); + } + printf("\n"); + } + + if(heavy_line0 ;number[sz]=rand()%10+'0',--sz); + number[0]=rand()%9 + '1'; + printf("%s ",number); + } + printf("\n"); + } + + for(++i;i0 ;number[sz]=rand()%10+'0',--sz); + number[0]=rand()%9 + '1'; + printf("%s ",number); + } + printf("\n"); + } + return 0; +} + -- cgit v1.2.3