Hej
Może mi ktoś spojrzeć dlaczego ten programik wypisuje else?
#include <iostream>
using namespace std;
int main()
{
srand(static_cast<unsigned>(time(0)));
for (int i = 0 ; i < 22 ; ++i)
{
if (rand()%4 == 3)
cout<<"1"<<endl;
else if (rand()%4 == 2)
cout<<"2"<<endl;
else if (rand()%4 == 1)
cout<<"3"<<endl;
else if (rand()%4 == 0)
cout<<"4"<<endl;
else
cout<<"Blad."<<endl;
}
getchar();
return 0;
}