Ultima modifica da un moderatore:
#include<iostream>
#include<windows.h>
using namespace std;
int main(){
while(1==1){
system("color 1c");
int randomizzo[5] = {1,2,3,4,5,};
randomizzo[1] = 10;
randomizzo[2] = 25;
randomizzo[3] = 42;
randomizzo[4] = 31;
randomizzo[5] = 57;
for(int i = 0; i < randomizzo[1];i++)
for(int i = 0; i < randomizzo[2];i++)
for(int i = 0; i < randomizzo[3];i++)
for(int i = 0; i < randomizzo[4];i++)
for(int i = 0; i < randomizzo[5];i++)
srand(static_cast<unsigned>(time(NULL)));
randomizzo[1]= rand() % 27;
randomizzo[2]= rand() % 59;
randomizzo[3]= rand() % 37;
randomizzo[4]= rand() % 50;
randomizzo[5]= rand() % 90;
randomizzo[6]= rand() % 90;
randomizzo[7]= rand() % 90;
randomizzo[8]= rand() % 90;
randomizzo[9]= rand() % 90;
randomizzo[10]=rand() % 90;
cout << " EsTrAzIoNi Dell OttO c.32.41.1" << endl;
Beep(124,532);
Beep(432,421);
Beep(324,423);
cout << "" << endl;
cout << " primo numero" <<"..."<<randomizzo[6]<< endl;
cout << "" << endl;
cout << "secondo numero" << "..." << randomizzo[7] << endl;
cout << "" << endl;
cout << "terzo numero" <<"..." << randomizzo[8] << endl;
cout << " " << endl;
cout << " quarto numero " <<"..." << randomizzo[9] << endl;
cout << ""<< endl;
cout << " quinto numero" << "..." << randomizzo[10] << endl;
cout << " immetti un numero" << endl;
cin >> randomizzo[1];
Beep(100,100);
cout << " immettine un ALTRO" << endl;
cin >> randomizzo[2];
Beep(200,100);
cout << " immetti un altro numero" << endl;
cin >> randomizzo[3];
Beep(300,100);
cout << " immetti un altro numero " << endl;
cin >> randomizzo[4];
Beep(400,100);
cout << " immetti l ultimo numero " << endl;
cin >> randomizzo[5];
Beep(500,100);
cout << " il primo numero estratto..." << randomizzo[1] << endl;
cout << " secondo numero estratto..." << randomizzo[2] << endl;
cout << " terzo numero estratto..." << randomizzo[3] << endl;
cout << " quarto numero estratto..." << randomizzo[4] << endl;
cout << " quinto ed ultimo numero estratto..." << randomizzo[5] << endl;
system("pause");
system("cls");
if(randomizzo[1] == randomizzo[6])
{
cout << " e uscito il numero della tabella...." << randomizzo[6] << endl;
}
if(randomizzo[2] == randomizzo[7])
{
cout << " e uscito il numero della tabella...." << randomizzo[7] << endl;
}
if(randomizzo[3] == randomizzo[8])
{
cout << " e uscito il numero della tabella...." << randomizzo[8] << endl;
}
if(randomizzo[4] == randomizzo[9])
{
cout << " e uscito il numero della tabella...." << randomizzo[9] << endl;
}
if(randomizzo[5] == randomizzo[10])
{
cout << " e uscito il numero della tabella...." << randomizzo[10] << endl;
system("pause");
system("cls");
}
}
}
ovviamente sarebbe stato meglio aggiungere un vettore ma la console mi dava errori quando avviavo il programma dicendomi che il runtime non era disponibile o cose del genere... GRAZIE IN ANTICIPO PER LE RISPOSTE!!!
#include<windows.h>
using namespace std;
int main(){
while(1==1){
system("color 1c");
int randomizzo[5] = {1,2,3,4,5,};
randomizzo[1] = 10;
randomizzo[2] = 25;
randomizzo[3] = 42;
randomizzo[4] = 31;
randomizzo[5] = 57;
for(int i = 0; i < randomizzo[1];i++)
for(int i = 0; i < randomizzo[2];i++)
for(int i = 0; i < randomizzo[3];i++)
for(int i = 0; i < randomizzo[4];i++)
for(int i = 0; i < randomizzo[5];i++)
srand(static_cast<unsigned>(time(NULL)));
randomizzo[1]= rand() % 27;
randomizzo[2]= rand() % 59;
randomizzo[3]= rand() % 37;
randomizzo[4]= rand() % 50;
randomizzo[5]= rand() % 90;
randomizzo[6]= rand() % 90;
randomizzo[7]= rand() % 90;
randomizzo[8]= rand() % 90;
randomizzo[9]= rand() % 90;
randomizzo[10]=rand() % 90;
cout << " EsTrAzIoNi Dell OttO c.32.41.1" << endl;
Beep(124,532);
Beep(432,421);
Beep(324,423);
cout << "" << endl;
cout << " primo numero" <<"..."<<randomizzo[6]<< endl;
cout << "" << endl;
cout << "secondo numero" << "..." << randomizzo[7] << endl;
cout << "" << endl;
cout << "terzo numero" <<"..." << randomizzo[8] << endl;
cout << " " << endl;
cout << " quarto numero " <<"..." << randomizzo[9] << endl;
cout << ""<< endl;
cout << " quinto numero" << "..." << randomizzo[10] << endl;
cout << " immetti un numero" << endl;
cin >> randomizzo[1];
Beep(100,100);
cout << " immettine un ALTRO" << endl;
cin >> randomizzo[2];
Beep(200,100);
cout << " immetti un altro numero" << endl;
cin >> randomizzo[3];
Beep(300,100);
cout << " immetti un altro numero " << endl;
cin >> randomizzo[4];
Beep(400,100);
cout << " immetti l ultimo numero " << endl;
cin >> randomizzo[5];
Beep(500,100);
cout << " il primo numero estratto..." << randomizzo[1] << endl;
cout << " secondo numero estratto..." << randomizzo[2] << endl;
cout << " terzo numero estratto..." << randomizzo[3] << endl;
cout << " quarto numero estratto..." << randomizzo[4] << endl;
cout << " quinto ed ultimo numero estratto..." << randomizzo[5] << endl;
system("pause");
system("cls");
if(randomizzo[1] == randomizzo[6])
{
cout << " e uscito il numero della tabella...." << randomizzo[6] << endl;
}
if(randomizzo[2] == randomizzo[7])
{
cout << " e uscito il numero della tabella...." << randomizzo[7] << endl;
}
if(randomizzo[3] == randomizzo[8])
{
cout << " e uscito il numero della tabella...." << randomizzo[8] << endl;
}
if(randomizzo[4] == randomizzo[9])
{
cout << " e uscito il numero della tabella...." << randomizzo[9] << endl;
}
if(randomizzo[5] == randomizzo[10])
{
cout << " e uscito il numero della tabella...." << randomizzo[10] << endl;
system("pause");
system("cls");
}
}
}
ovviamente sarebbe stato meglio aggiungere un vettore ma la console mi dava errori quando avviavo il programma dicendomi che il runtime non era disponibile o cose del genere... GRAZIE IN ANTICIPO PER LE RISPOSTE!!!