Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <cstdio>
- #include <time.h>
- using namespace std;
- #ifdef _WIN32
- #define PAUSE (system("PAUSE"))
- #else
- #define PAUSE (getchar())
- #endif
- int main ()
- {
- //Lo scopo di questo Programma è di scegliere un numero casuale tra 3-5 e 24-35.
- int numero_random1, numero_random2;
- int numero_finale[30];
- srand((unsigned int)time(0));
- for( int i=0; i < 30; i+=2)
- {
- numero_random1 = rand() % 3 + 3;
- numero_random2 = rand() % 12 + 24;
- numero_finale[i] = numero_random1;
- numero_finale[i+1] = numero_random2;
- cout<<numero_random1<<" - "<<numero_random2<<" || array -> "<<numero_finale[i]<<" - "<<numero_finale[i+1]<<endl<<endl;
- }
- //cout<< numero_random1<<endl<<numero_random2;
- cout<<" Il numero Random Generato alla fine è -> "<< numero_finale[rand() % 30];
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement