#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
int main()
{
const int wordc = 4;
const char* const data[wordc] = {"Ork", "Elf", "Czlowiek", "Krasnolud",}<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
int rword;
std::srand(std::time(NULL))<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
rword = std::rand() % wordc;
std::cout << "Wylosowales rase:" << data[rword] <<"\n"<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
if(rword = 0)
std::cout << "aaa \n"<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
else if(rword = 1)
std::cout << "bbb \n"<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
else if(rword = 2)
std::cout << "ccc \n"<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
else if(rword = 3)
std::cout << "ddd \n"<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
system("pause")<img src='http://forum.pcfoster.pl/public/style_emoticons/<#EMO_DIR#>/disagree.png' class='bbc_emoticon' alt=';' />
}
I chciałbym aby zależnie od tego którą rasę wylosuje program to będzie on robił daną czynność. Niestety w przypadku if-ów to nie działa, albo ja tego nie umiem zrobić. Chciałbym kogoś poprosić, aby zmienił ten tekst źródłowy tak, aby program ten działał i jeśli można o wytłumaczenie, gdzie zrobiłem błąd i na czym polega poprawne rozwiązanie. Dodam, że jestem początkującym programistą, c++ uczę się od około tygodnia. Za pomoc z góry dziękuję.
PS:
tak, wiem mogłem użyć using namespace std




