mne nejde ten program Dev-C++ aj kd dam na konec dvakrat cin.get();. proste ho idem skompilovat a vypise mi ze to neni skompilovane a nespusti sa. nevies co s tym je?
Fórum › C / C++
Program

Jako každému - pokud máš nějakej problém s kódem, tak ho ZVEŘEJNI, takhle ti můžem říct akorát, že tam chybu máš, stěží ale budem vědět jakou.
#include <iostream>
using namespace std;
int main()
{
int skoreSparta, skoreSlavia:
skoreSparta = 2;
skoreSlavia = 2;
cout << "Vlozte skore sparty:";
cin >> skoreSparta;
cout << "Vlozte skore slavie:";
cin >> skoreSlavia;
cout << "n";
if (skoreSparta > skoreSlavia)
cout << "Sparta do toho!n";
{
if (skoreSparta < skoreSlavia)
}
if (soreSparta == skoreSlavia)
{
cout << "Vyrovnane skore? To neni mozne!n";
cout << "Zadajte skutocne skore Slavie:";
cin >> skoreSlavia;
if (skoreSparta > skoreSlavia)
cout << "Vedel som to! Sparta do toho!";
if (skoreSlavia > skoreSparta)
cout << "Vedel som to! Slavia do toho!";
if (skoreSparta == skoreSlavia)
cout << "Aha, je to skutocne vyrovnane!";
cout << "Diky za informacie.n";
cin.get();
cin.get();
return 0;
}
toto je ten zdrojak ktory mi nejde spustit. ale ja si myslim ze to bude v niecom inom a nie v zdrojaku lebo programy ktore som aj predtym robil mi isli a skusil som si otvorit ten zdrojak nejakeho stareho programu a namiesto napriklad
2 * 3 som dal 5 * 6 a nic neslo to vysledok sa nezmenil. ale nejak pred tromi dnami mi to este islo a co sa tyka prikazov v tom zdrojaku tak som ziadny nemenil takze si myslim ze by som mohol mat nieco zle nastavene v programu nie?:((
#include <iostream>
using namespace std;
int main()
{
int skoreSparta, skoreSlavia;
skoreSparta = 2;
skoreSlavia = 2;
cout << "Vlozte skore sparty:";
cin >> skoreSparta;
cout << "Vlozte skore slavie:";
cin >> skoreSlavia;
cout << "n";
if (skoreSparta > skoreSlavia)
cout << "Sparta do toho!n";
else if (skoreSparta < skoreSlavia)
cout << "Slavia do toho!n";
else if (skoreSparta == skoreSlavia) {
cout << "Vyrovnane skore? To neni mozne!n";
cout << "Zadajte skutocne skore Slavie:";
cin >> skoreSlavia;
if (skoreSparta > skoreSlavia)
cout << "Vedel som to! Sparta do toho!";
else if (skoreSlavia > skoreSparta)
cout << "Vedel som to! Slavia do toho!";
else if (skoreSparta == skoreSlavia)
cout << "Aha, je to skutocne vyrovnane!";
}
cout << "Diky za informacie.n";
cin.get();
cin.get();
return 0;
}
Jinak m?t t? po ruce, asi bych t? zpohlavkoval. P?r z?kladn?ch bod?:
a) p??kaz mus? b?t uzav?en pomoc? ;, ne pomoc? :
b) n?zvy prom?nn?ch mus? b?t stejn?
c) pokud n?kam vlo??? {, za??n?? blok p??kaz?, bezd?vodn? blok p??kaz? uprost?ed programu je k ni?emu.
d) v?echny bloky p??kaz? mus? b?t uzav?en?.
e) za podm?nkou if mus? b?t p??kaz nebo blok
f-z) ne? se zept?? tak laskav? strav nad sv?m programem alespo? 5 minut!!!!!!!!!!!! V?pis chyb je od toho, aby jsi se dozv?d?l, kde jsou chyby, ne abys ho ignoroval!!!!!!!!!!!!!!!!

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
Program, ktory otvori iny program — založil Nummi
C# program — založil Tomas.P
Program do C++ — založil elis5
Moderátoři diskuze