Aurox_

Untitled

Oct 26th, 2023
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <limits.h>
  5.  
  6. #define MAXLEN 1000
  7. #define STRLEN 64
  8.  
  9. void main(void)
  10. {
  11.   int i,len,bin[MAXLEN],check;
  12.   char input[STRLEN];
  13.  
  14.   for(i=0;i<MAXLEN;i++)
  15.       bin[i]=0;
  16.  
  17.   do
  18.     {
  19.       printf("Quanti bin vuoi che usi?\n");
  20.       scanf("%s",input);
  21.       n=atoi(input);
  22.       if(n>=MAXLEN)
  23.         {
  24.           printf("Mi dispiace, non posso generare così tanti bin, inserisci un numero minore di %d.\n",MAXLEN);
  25.         }
  26.       else
  27.         check=1;
  28.     }
  29.   while(check!=1);
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment