C++
Prikazujem rezultate 1 do 10 od 10

Tema: C++

  1. #1
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano C++

    Evo ovdje mozete staviti kod vlastitog C++ projekta, da ga svi mogu prokomentarisati, upotrijebiti itd.
    Pozeljno je da su kodovi provjereni, da se moze izvrsiti klasicni copy/paste.
    Pa posto sam ja otvorio temu, red je i da zapocnem sa kodovima.
    Kod:
    // Calculating application
    // by: Miljan Sucur 
    
    #include <iostream>
    using namespace std;
    
    //Function for girth
    //using 2 integers and return girth
    int obim(int x, int y)
    {
    	return ((2*x)+(2*y));
    }
    
    //Function for area
    int povrsina(int x, int y)
    {
    	return(x*y);
    }
    
    //Function for Main menu
    void menu()
    {
    	cout << "\n******** M E N U ********";
    	cout << "\nGIRTH\t\t\t(1)\nAREA\t\t\t(2)\nNEW DIMENSIONS\t\t(3)";
    	cout << "\nDRAW SHAPE\t\t(4)\nCURRENT DIMENSIONS\t(5)";
    	cout << "\nMENU\t\t\t(6)\nEXIT\t\t\t(0)\n";
    }
    
    //Class for dimensions
    class broj
    {
    public:
    	broj();
    	~broj();
    	int getDuzina();
    	int getSirina();
    	void setDuzina(int &sDuzina);
    	void setSirina(int &sSirina);
    private:
    	int Duzina;
    	int Sirina;
    
    
    };
    //Constructor make default dimensions to 4 and 6
    broj::broj()
    {
    	Duzina = 4;
    	Sirina = 6;
    }
    broj::~broj()
    {}
    //Set lenght
    void broj::setDuzina(int &sDuzina)
    {
    	Duzina = sDuzina;
    }
    //Set width
    void broj::setSirina(int &sSirina)
    {
    	Sirina = sSirina;
    }
    //Return values
    int broj::getDuzina()
    {
    	return Duzina;
    }
    int broj::getSirina()
    {
    	return Sirina;
    }
    	
    //Main function
    int main()
    {
    	cout<<"##### ##### ##### #    # ##### ##### ##### #   #\n";
    	cout<<"#     #     #   # ##  ## #       #   #   # #   #\n";
    	cout<<"#  ## ##### #   # # ## # #####   #   ##### #####\n";
    	cout<<"#   # #     #   # #    # #       #   ###       #\n";
    	cout<<"##### ##### ##### #    # #####   #   #  ## ##### CALCULATOR\n\n";
    	broj kocka;
    	int n,d,s;
    	int a,b;
    	n = 0;
    	int &mNumber = n;
    	menu();
    	
    while (n < 7)
    {
    a = kocka.getDuzina();
    b = kocka.getSirina();
    cout << "\nChoose: ";
    cin >> n;
    
    	if (n == 0)
    	{cout << "\nEXITING!\n\n\n";
    	break;}
    switch (n)
    case 1:
    	{
    		cout << "\n************************************\nGirth of shape:";
    		cout << " " << obim(a,b)<< "\n************************************\n";
    	break;
    case 2:
    	
    		cout << "\n************************************\nArea of shape:";
    		cout << " " << povrsina(a,b)<<"\n************************************\n";
    	break;
    case 3:
    	cout << "\nInput new size for lenght: ";
    		cin >> d;
    		cout << "Input new size for width: ";	
    		cin >> s;
    	kocka.setDuzina(d);
    	kocka.setSirina(s);
    	break;
    case 4:
    	cout << "\n";
    	int i,j;
    	for (i=0;i<a;i++)
    	{
    	for (j=0;j<b;j++)
    	cout << "* ";
    	cout << "\n";}
    	break;
    case 5:
    	cout << "\nCurrent dimensions: ";
    	cout << "\n************************************\nLenght= " << a;
    	cout <<"\nWidth= " << b << "\n************************************\n";
    	break;
    case 6:
    	menu();
    	break;
    case 0:
    	break;
    default:
    	cout << "\n********************************************************\n";
    	cout << "Wrong solution, please try again (call menu, press (6))\n";
    	cout << "********************************************************\n\n";
    	return main();
    	}}
    system("PAUSE");
    }



  2. #2
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano

    Zar niko ništa neradi u C++-u ???
    Ja evo sada radim na nekoj dos igrici, virtualna kladionica, pa ako neko ima kakvih ideja, put here.

  3. #3
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano

    Evo zavrsih osnovne stvari aplikacije, da moze u potpunosti funkcionisati, sada je samo obogacujem novim opcijama i sa vise sadrzaja, dinamike itd.
    Nego zna li ko neki file host, da okacim ovo sto sam do sada uradio,300kb.

  4. #4
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano

    Evo par screenshota, cisto da vidite o cemu se radi.
    Sve ideje su dobrodosle.


  5. #5
    Zainteresovan član Anak1n (avatar)
    Učlanjen
    23.06.2005.
    Lokacija
    Dark place
    Poruke
    204
    Reputaciona moć
    48

    Podrazumevano

    ne razumem zasto nisi komentarisao kod na srpskom???
    :? :? :?

  6. #6
    Iskusan codemaker (avatar)
    Učlanjen
    05.04.2004.
    Lokacija
    Beograd
    Poruke
    6.416
    Reputaciona moć
    0

    Podrazumevano

    Ajd' sad Sucure, brate..

  7. #7
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano

    Citat Original postavio Anak1n
    ne razumem zasto nisi komentarisao kod na srpskom???
    :? :? :?
    Ma nije onaj gore kod od ove aplikacije, ono je potpuno drugi program.
    A za ovaj nisam još objavio kod, jer je veoma velik, a i komplikovan, tako da nema mnogo koristi od njega za posmatrace, al ako ga neko zeli nema problema, recite, al napomiljen veoma je dug.
    Pa sam zato stavio samo screenshotove.

  8. #8
    Zainteresovan član Anak1n (avatar)
    Učlanjen
    23.06.2005.
    Lokacija
    Dark place
    Poruke
    204
    Reputaciona moć
    48

    Podrazumevano

    Brate meni ne treba....ionako sve igraonice vec imaju programe i mislim da bi se tesko odlucili da predju na drugi.....a sta moze ovaj tvoj sto si ga napravio.....daj neke detalje...malo si me zainteresovo.... a mozes i poslati kod na red.zmaja@gmail.com [valjda ima mesta] pa da pogledam malo...

  9. #9
    Zainteresovan član Anak1n (avatar)
    Učlanjen
    23.06.2005.
    Lokacija
    Dark place
    Poruke
    204
    Reputaciona moć
    48

    Podrazumevano

    A program pokriva samo single meceve--

  10. #10
    Ističe se juznivetar (avatar)
    Učlanjen
    12.02.2005.
    Pol
    muški
    Lokacija
    -
    Poruke
    2.041
    Reputaciona moć
    67

    Podrazumevano

    Nije ovo program za kladionice, nego igra.
    Za sada je samo single mac, al cim nadjem neku povoljnu soluciju, za vise meceva, stavit cu je.
    Evo kod, samo ponavljam igra je u razvoju i ovo je funkcionalan kod, al ne sa svim implementiranim stvarima koje imam na umu da stavim.
    Stavio sam Banku. Za iznajmljivanje novca.

    Kod:
    //Kladionica
    #include <cstdlib>
    #include <ctime>
    #include <iostream>
    
    using namespace std;
    
    // Glavni meni
    
    void menu()
    {
    	cout << "\n####### INTERNET EXPLORER #######\n";
    	cout << "---------------------------------\n";
    	cout << "NOVI PAROVI\t  \t  (1)\n";
    	cout << "TRENUTNI PAROVI\t\t  (2)\n";
    	cout << "KVOTE\t\t          (3)\n";
    	cout << "MENI\t\t \t  (4)\n";
    	cout << "STATUS\t\t          (5)\n";
    	cout << "UPLATA.TIKET.MEC          (6)\n";
    	cout << "POMOC\t\t          (7)\n";
    	cout << "BANKA\t\t          (8)\n";
    	
    };
    
    // Postavljanje klubova koji ce se takmiciti
    
    
    int main()
    {
    	cout << "##### ##### #####\n";
    	cout << "#   # #       #  \n";
    	cout << "####  #####   #  \n";
    	cout << "#   # #       #  \n";
    	cout << "##### #####   #   BY: MILJAN SUCUR\n\n";
    	float zajam = 0;
    	float renta = 0;
    	int counter = 0;
    	char ime [100];
    	char prezime [100];
    	char fc [100];
    	float edobitak = 0;
    	float dobitak = 0;
    	float gubitak = 0;
    	float udobitak = 0;
    	float ugubitak = 0;
    	char club [40][20]={"Parma","AS Roma","AC Milan","Internazionale","SS Lazio","Lecce",//5
    	"Real Madrid","Barcelona FC","Valencia","Villareal","Sevilla","FC Liverpool",//11
    	"Manchester United","Arsenal","FC Chelsea","Bordeaux","FC Lyon","PSG","Monaco",//18
    	"Crvena zvezda","Partizan","Celtic","Porto","Wisla Krakow","Dinamo Kyev",//24
    	"Spartak Moscow","Lokomotiv Moscow","Benfica","Sparta Prague","Galatasaray",//29
    	"Borussia Dortmund","Bayern Munchen","Stuttgart","Werder Bremen","Newcastle Utd",//34
    	"GAK","Austria","Feyenoord","Ajax","PSV"};//39
    	char dani [7][15] = {"Ponedeljak","Utorak","Srijeda","Cetvrtak","Petak",
    		"Subota","Nedelja"};
    	int d =0;
    	//Osnovni podatci o korisniku
    	
    	cout << "******* PODATCI *******\n\n";
    	cout << "MOLIMO VASE IME: ";
    	cin.getline (ime,100);
    	cout << "MOLIMO VASE PREZIME: ";
    	cin.getline (prezime,100);
    	cout << "MOLIMO IME VASEG OMILJENOG KLUBA: ";
    	cin.getline (fc,100);
    	cout << "\n";
    	char club1[20];
    	char club2[20];
    	float novac = 100;
    	menu();
    	int timer = 0;
    	int sss;
    	float kv1;
    	srand(time(0));
    	kv1 = 1.05 + (rand() % 3);
    	float kv2;
    	kv2 = 1.05 + (rand() % 3);
    	float kv3;
    	kv3 = 2.1 + (rand() % 3);
    	
    	//Petlja i uslov ispunjenja kraja igre
    
    	while(novac >= 1)
    	{
    	if(timer == 10)
    	{
    		cout << "\nImate novi mail, upisite bilo koji broj i kliknite ENTER da procitate: ";
            cin >> sss;
    		cout << "\n\n####### NASLJEDSTVO #######\n";
    		cout << "-------------------------------------------\n";
    		cout << "Jedini ste nasljednik, vaseg dalekog rodjaka i na osnovu toga dobijate:";
    		int nas;
    		srand(time(0));
    		nas = (rand() % 100);
    		cout << "\nSUMU U IZNOSU OD: " << nas << " $\n";
    		novac = novac + nas;
    		timer++;
    		cout << "-------------------------------------------\n";
    
    	}
    		if(timer == 20)
    	{
    		cout << "\nImate novi mail, upisite bilo koji broj i kliknite ENTER da procitate: ";
            cin >> sss;
    		cout << "\n\n####### PORESKA UPRAVA #######\n";
    		cout << "-------------------------------------------\n";
    		cout << "Zbog neplacenih racuna na vrijeme, dobili ste novcanu kaznu: ";
    		int nas;
    		srand(time(0));
    		nas = (rand() % 100);
    		cout << "\nU IZNOSU OD: " << nas << " $\n";
    		novac = novac - nas;
    		timer++;
    		cout << "-------------------------------------------\n";
    
    	}
    	if((timer == 7) || (timer == 31) || (timer == 57))
    	{
    		cout << "\nImate novi mail, upisite bilo koji broj i kliknite ENTER da procitate: ";
            cin >> sss;
    		cout << "\n\n####### ZARADA #######\n";
    		cout << "-------------------------------------------\n";
    		cout << "Imam strasan par 100% pogadjam, ali nemam novac za uplatu. ";
    		cout << "\nDaj mi 20$, ako pogodim dobijas 40$, ako ne nikom nista, al' siguran dobitak.";
    		cout << "\nOPCIJE:\n";
    		cout << "          (1) Pristajem";
    		cout << "\n          (2) Odbijam";
    		cout << "\nODLUKA: ";
    		int odluka;
    		cin >> odluka;
    		while ((odluka != 1) || (odluka !=2))
    		{
    			if ((odluka == 1) || (odluka == 2))
    				break;
    			else
    			{
    				cout << "POGRESNA SOLUCIJA, POKUSAJTE PONOVO: ";
    				cin >> odluka;
    			}
    		}
    
    		if (odluka == 1)
    		{
    			novac = novac - 20;
    			int rrr;
    			cout << "\nSTIGAO JE MAIL SA REZULTATOM,UKUCAJTE NEKI BROJ I STISNITE 'ENTER': ";
    			int start;
    			cin >> start;
    		srand(time(0));
    		rrr = (rand() % 2);
    		if (rrr == 0)
    		{
    			cout << "-------------------------------------------\n";
    			cout << "Naravno pogodili smo, imao sam takav osjecaj, evo tvojih 40$.\n";
    			novac = novac + 40;
    		}
    		if(rrr == 1)
    		{
    			cout << "-------------------------------------------\n";
    			cout << "Nemogu da vjerujem, da nisam pogodio, zao mi je.\n";
    		}
    		}
    		if (odluka == 2)
    		{
    			cout << "\nUredu, ali kajat cete se !!!\n";
    		}
    		timer++;
    		cout << "-------------------------------------------\n";
    
    	}
    	if(timer == 4)
    	{
    		cout << "\nImate novi mail, upisite bilo koji broj i kliknite ENTER da procitate: ";
            cin >> sss;
    		cout << "\n\n####### ANONIMUS #######\n";
    		cout << "-------------------------------------------\n";
    		cout << "Ja sam vas prijatelj, imam dojavu da ce u danasnjem mecu domacin pobijediti.";
    		cout << "\nDojava je od veoma uticajne fudbalske licnosti !!!";
    		cout << "\n-------------------------------------------\n";
    		timer++;
    	}
    	if((novac == 50) || (novac == 31) || (novac == 85) || (novac == 102) || (novac == 254)
    		|| ( novac == 72) || (novac == 255) || (novac == 5))
    	{
    		cout << "\nImate novi mail, upisite bilo koji broj i kliknite ENTER da procitate: ";
            cin >> sss;
    		cout << "\n\n####### INFORMACIJA #######\n";
    		cout << "-------------------------------------------\n";
    		cout << "Veoma sam nadaren za sportsku prognozu, tako ako si pametan, poslusat ces me.";
    		cout << "\nNa danasnjoj utakmici stavi: ";
    		srand(time(0));
    		int b;
    		b = (rand() % 3);
    		cout << b;
    		cout << "\nPlatili ste porez na informaciju 1$.";
    		novac = novac - 1;
    		cout << "\n-------------------------------------------\n";
    	}
    	int broj;
    	cout << "\nODABERITE OBLAST: ";
    	cin >> broj;
    	if (broj == 0)
    	{
    	cout << "\nIZLAZ...\n\n";
    	break;
    	}
    	cin.ignore (100,'\n');
    		switch (broj)
    		case 1:
    		{
    			cout << "\n####### NOVI PAROVI #######\n";
    		    srand(time(0));
    			int c1;
    			c1 = (rand() % 40);
    			int c11;
    			c11 = c1;
    			int c2;
    			c2 = (rand() % 40);
    			int c22;
    			c22 = c2;
    			cout << "-------------------------------------------\n";
    			cout << "MEC: \n";
    			cout << "         " << club[c11] << " : " << club[c22];
    			cout <<"\n-------------------------------------------\n";
    			d++;
    			if (d == 7)
    			{
    				d = 0;
    			};
    			if (zajam != 0)
    			{
    				renta = ((zajam * 7)/100);
    				zajam = zajam + renta;
    				counter++;
    			};
    			if (zajam == 0)
    			{
    				zajam = 0;
    				counter = 0;
    			};
    			if (counter == 5)
    			{
    			cout << "\n####### OSTALO JE 5 DANA, NAPOMENA #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "Ostalo je jos 5 dana do isplate kredita, trenutni dug je " << zajam << "$.\n";
    			};
    			if (counter == 10)
    			{
    				cout << "\n####### PROSLO JE 10 DANA, KREDIT NIJE VRACEN #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "Zbog toga banka vam silom oduzima " << zajam << "$.\n";
    			novac = novac - zajam;
    			counter = 0;
    			zajam = 0;
    			};
    
    			//------------------- kvote -------------------------------------------------
    
    srand(time(0));
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31))
    			{
    				srand(time(0));
    				kv1 = 1.1 +(rand() % 2);
    			};
    		if((c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv2 = 1.3 +(rand() % 2);
    			};
    		if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39))
    			{
    				srand(time(0));
    				kv1 = 1.3 +(rand() % 3);
    			};
    		if((c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				kv2 = 1.5 +(rand() % 3);
    			};
    		if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38))
    			{
    				srand(time(0));
    				kv1 = 1.4 +(rand() % 4);
    			};
    		if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				kv2 = 1.6 +(rand() % 4);
    			};
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv1 = 2 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.2 +(rand() % 2);
    			};
    			if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39)
    			&& (c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				kv1 = 2.1 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.3 +(rand() % 2);
    			};
    			if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38)
    			&&(c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				kv1 = 1.9 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.1 +(rand() % 2);
    			};
    			if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    			srand(time(0));
    				kv1 = 1.4;
    				srand(time(0));
    				kv2 = 2.1 +(rand() % 3);
    			};
    			if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv1 = 2.3 + (rand () % 3);
    				srand(time(0));
    				kv2 = 1.7;
    			};
    			kv3 = 2.1 + (rand() % 3);
    
    
    			//----------------------------------- kvote kraj ------------------------------
    		break;
    		case 2:
    		cout << "\n####### DANASNJI MEC #######";
    		cout << "\n-------------------------------------------\n";
    		cout << "DAN:\n       " << dani[d] << "\n";
    		cout << "MEC:\n       " << club[c11] << " : " << club[c22];
    		cout << "\n-------------------------------------------\n";
    		break;
    		case 3:
    			
    			cout << "\n####### KVOTE #######\n";
    			cout <<   "-------------------------------------------\n";
    			cout << "                        " << club[c11] << "\n";
    			cout << "DOMACIN POBJEDJUJE:     " << kv1 << "\n";
    			cout << "NERIJESEN REZULTAT:     " << kv3 << "\n";
    			cout << "GOST POBJEDJUJE   :     " << kv2 << "\n";
    			cout << "                        " << club[c22] << "\n";
    			cout << "-------------------------------------------\n";
    			break;
    		case 4:
    			menu();
    			break;
    		case 5:
    			cout << "\n####### STATUS #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "IME: ";
    			cout << "\n                    " << ime;
    			cout << "\nPREZIME: ";
    			cout << "\n                    " << prezime;
    			cout << "\nOMILJENI KLUB: ";
    			cout << "\n                    " << fc;
    			cout << "\nDOBITAK: ";
    			cout << "\n                    " << udobitak;
    			cout << "\nGUBITAK: ";
    			cout << "\n                    " << ugubitak;
    			cout << "\nUKUPAN BUDZET: ";
    			cout << "\n                    " << novac << " $";
    			cout << "\n-------------------------------------------\n";
    			break;
    		case 7:
    				cout << "\n####### POMOC #######\n";
    				cout << "-------------------------------------------\n";
    				cout << "Dobrodosli u virtualnu kladionicu!";
    				cout << "\nKada popunite osnovne podatke potrebno je odabrati opciju (1) ";
    				cout << "\nda bi igra generisala prvi par, poslije svakog narednog odigravanja\n";
    				cout << "meca nije potreban ponovan odabir (1), jer ce program automatski\n";
    				cout << "odabrati novi par, sem ukoliko vam neodgovara taj par.";
    				cout << "\nPotrebno je ukucavati ispravne znakove koje nalaze program\n";
    				cout << "da nebi doslo do pada istog. Vas iznos nesmije biti manji od 1 $\n";
    				cout << "cim predje tu svotu igra je zavrsena - bankrot.";
    				cout << "\nZa sve bagove,prijedloge, pohvale itd. kontakt mrx87cole82@spinter.net";
    				cout << "\nSRECNO !!!";
    				cout << "\n-------------------------------------------\n";
    				break;
    		case 8:
    
    			//--------------------------- BANKA -------------------------------------
    			
    			cout << "\n####### BANKA #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "PONUDA:\n";
    			cout << "                      (0) BANKOVNI STATUS\n";
    			cout << "                      (1) UZETI KREDIT \n";
    			cout << "                      (2) VRATITI NOVAC OD KREDITA\n";
    			cout << "                      (5) IZLAZ\n";
    			cout << "-------------------------------------------\n";
    			
    			cout << "IZABERITE: ";
    			int izbor;
    			cin >> izbor;
    			cout << "-------------------------------------------\n";
    			if (izbor == 5)
    			{
    				cout << "\nDOVIDJENJA...";
    				cout << "\n-------------------------------------------\n";
    				break;
    			}
    			int kredit;
    			if (izbor == 1)
    			{
    			cout << "\n####### KREDIT #######";
    			cout << "\n-------------------------------------------\n";
    			if (zajam != 0)
    			{
    				cout << "\n\nNISTE JOS OTPLATILI POSLJEDNJI KREDIT !!!";
    				cout << "\n-------------------------------------------\n";
    				break;
    			}
    			cout << "ZELITE UZETI KREDIT: ";
    			cout << "\n\nOPCIJE (0) DA ili (1) NE : ";
                cin >> kredit;
    			while ((kredit != 0 || kredit != 1))
    			{
    				if ((kredit == 0 || kredit == 1))
    					break;
    				if ((kredit != 0 || kredit != 1))
    				{
    					cout << "POGRESNA SOLUCIJA, POKUSAJTE PONOVO: ";
    					cin >> kredit;
    				}
    			}
    			if (kredit == 1)
    				break;
    			int isplata;
    			int max = 100;
                if (kredit == 0)
    			{
    				cout << "\n-------------------------------------------\n";
    				cout << "PRAVILA: \n";
    				cout << "         MOZETE PODICI KREDIT UKUPNO 1 PUT. NAKON VRACANJA MOZETE PONOVO.\n";
    				cout << "         MAKSIMALNO MOZETE UZETI 100$\n";
    				cout << "         KAMATA JE +7% SVAKI DAN. ROK VRACANJA 10 DAN.\n\n";
    				cout << "UZIMATE KOLIKO: ";
    				cin >> zajam;
    				while ((zajam > 100) || (zajam < 1))
    				{
    					if ((zajam <= 100) && (zajam >= 1))
    						break;
    					if ((zajam > 100) || (zajam < 1))
    					{
    						cout << "\nMAKSIMALNO 100$ I MINIMALNO 1$, PONOVITE: ";
    						cin >> zajam;
    					}
    				}
    				cout << "\n-------------------------------------------\n";
    				cout << "UREDU UZELI STE ZAJAM NA: " << zajam << "$.\n";
    				cout << "SVAKI DAN ZAJAM RASTE ZA 7%, ROK VRACANJA 10 DANA OD DANAS !\n";
    				novac = novac + zajam;
    				counter = 1;
    
    			}
    			}
    			if (izbor == 2)
    			{
    				if (zajam == 0)
    				{
    					cout << "\nVI NEMATE PODIGNUT KREDIT!\n";
    					break;
    				}
    				cout << "\n####### KREDIT #######";
    				cout << "\n-------------------------------------------\n";
    				cout << "DOBRODOSLI ZELITE DA VRATITE POZAJMLJENI NOVAC.\n";
    				cout << "DUGUJETE " << zajam << "$.\n";
    				cout << "VRACATE (0)SVE ili (1)DIO: ";
    				float vracanje;
    				cin >> vracanje;
    				while ((vracanje != 0) || (vracanje != 1))
    				{
    					if ((vracanje == 0) || (vracanje == 1))
    						break;
    					if ((vracanje != 0) || (vracanje != 1))
    					{
    						cout << "\nPOGRESNA SOLUCIJA, PONOVITE: ";
    						cin >> vracanje;
    					}
    				}
    				if (vracanje == 0)
    				{
    					if (novac < zajam)
    					{
    						cout << "\nZAO NAM JE, ALI NEMATE DOVOLJNO NOVACA!\n";
    					}
    					if (novac >= zajam)
    					{
    						cout << "\nUREDU NOVAC JE VRACEN, DOSJITE NAM PONOVO.\n";
    						novac = novac - zajam;
    						counter = 0;
    						zajam = 0;
    					}
    				}
    				float dio;
    				if (vracanje == 1)
    				{
    					cout << "\nUREDU KOLIKO ZELITE DA VRATITE: ";
    					cin >> dio;
    					if (zajam <= dio)
    					{
    						cout << "\nTO JE DOVOLJNO DA OTPLATITE SAV DUG, IDITE U TAJ ODJEL!\n";
    					};
    					if (zajam > dio)
    					{
    						cout << "\nUREDU DIO JE OTPLACEN.";
    						zajam = zajam - dio;
    						cout << " IMATE JOS DA VRATITE " << zajam << "$.\n";
    					};
    				}
    			}
    			if (izbor == 0)
    			{
    				if (zajam == 0)
    				{
    					cout << "\nNEMATE OTVOREN NALOG!\n";
    					break;
    				}
    				cout << "\n####### STATUS #######";
    				cout << "\n-------------------------------------------\n";
    				cout << "IME: \n";
    				cout << "                 " << ime << "\n";
    				cout << "PREZIME: \n";
    				cout << "                 " << prezime << "\n";
    				cout << "DUG: \n";
    				cout << "                 " << zajam << "$\n";
    				cout << "ROK ISPLATE: \n";
    				cout << "                 " << 10 - counter << " dana.\n";
    			}
    			
    			break;
    			
    
    		case 6:
    			cout << "\n####### UPLATA #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "DOBRODOSLI NA UPLATNO MJESTO";
    			cout << "\n-------------------------------------------\n";
    			float uplata;
    			cout << "TVOJ TRENUTNI BUDZET:    " << novac << " $";
    			cout << "\nPAR:  ";
    			cout << "\n      " << club[c11] << " vs. " << club[c22]; 
    			cout << "\n\nMOLIMO DA UNESETE VASU UPLATU:   ";
    		    cin >> uplata;
    			while (novac < uplata)
    			{
    				if (novac >= uplata)
    					break;
    				else
    				{
    					cout << "\nNEMATE TOLIKO NOVACA: ";
    					cin >> uplata;
    				}
    			}
    			int tip;
    		
    			cout << "TIPOVI: (1)DOMACIN (0)NERIJESENO (2)GOST";
    			cout << "\nMOLIMO ODABERITE TIP:   ";
    			cin >> tip;
    			while ((tip != 0) || (tip != 1) || (tip != 2))
    			{
    			if ((tip == 0) || (tip == 1) || (tip == 2))
    				break;
    			else
    			{
    				cout << "\nPOGRASNA SOLUCIJA, PONOVITE: ";
    				cin >> tip;
    			}
    			}
    			cout << "\n####### TIKET #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "DAN: ";
    			cout << "\n         " << dani[d];
    			cout << "\nPAR: ";
    			cout << "\n         " << club[c11] << " : " << club[c22];
    			cout << "\nTIP: ";
    			cout << "\n         " << tip;
    			cout << "\nKVOTA: ";
    			float kv;
    			if (tip == 0)
    			{
    				kv = kv3;
    				cout << "\n         " << kv;
              
    			}
    			if (tip == 1)
    			{
    				kv = kv1;
    				cout << "\n         " << kv1;
    			}
    			if (tip == 2)
    			{
    				kv = kv2;
    				cout << "\n         " << kv2;
    			}
    			cout << "\nUPLATA: ";
    			cout << "\n             " << uplata << " $";
    			edobitak = kv * uplata;
    			dobitak = kv * uplata;
    			gubitak = 0 - uplata;
    			cout << "\nEVENTUALNI DOBITAK: ";
    			cout << "\n                           " << edobitak << " $";
    			cout << "\n-------------------------------------------\n";
    
    		srand(time(0));
    	int rez1;
    			rez1 = 0 + (rand()%5);
    
    	int rez2;
    			rez2 = 0 + (rand() % 5);
    			
    			//------------------------------- REZULTAT -----------------------------
    
    			srand(time(0));
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand()%5);
    			};
    		if((c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				rez2 = 0 + (rand() % 5);
    			};
    		if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 4);
    			};
    		if((c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				rez2 = 0 + (rand() % 4);
    			};
    		if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 3);
    			};
    		if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				rez2 = 0 + (rand() % 3);
    			};
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 4);
    				srand(time(0));
    				rez2 = 0 + (rand() % 3);
    			};
    			if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39)
    			&& (c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 4);
    				srand(time(0));
    				rez2 = 0 + (rand() % 4);
    			};
    			if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38)
    			&&(c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 5);
    				srand(time(0));
    				rez2 = 0 + (rand() % 4);
    			};
    			if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    			srand(time(0));
    				rez1 = 0 + (rand() % 6);
    				srand(time(0));
    				rez2 = 0 + (rand() % 3);
    			};
    			if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				rez1 = 0 + (rand() % 4);
    				srand(time(0));
    				rez2 = 0 + (rand() % 5);
    			};
    
    			//---------------------------------------------------------------------------
    
    			cout << "\n####### ODIGRAVANJE UTAKMICE #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "UKUCAJTE NEKI BROJ I STISNITE 'ENTER': ";
    			int start;
    			cin >> start;
    			cout << "\n-------------------------------------------\n";
    			cout << "####### REZULTAT #######";
    			cout << "\n-------------------------------------------\n";
    			cout << club[c11] << "   " << rez1 << " : " << rez2 << "   " << club[c22];  
                int rr;
    			{
    			if (rez1 > rez2)
    				rr = 1;
    			if (rez1 == rez2)
    				rr = 0;
    			if (rez1 < rez2)
    				rr = 2;
    			};
    			int a = rr;
    			{
    				if(a == tip)
    				{	
    				cout << "\n\n*** CESTITAMO POGODILI STE ***";
    				cout <<"\n-------------------------------------------\n";
    				novac = novac + edobitak;
    				udobitak = udobitak + dobitak;
    				}
    				else 
    				{
    				cout << "\n\n*** POGRESNA PROGNOZA ***";
    				cout <<"\n-------------------------------------------\n";
    				novac = novac - uplata;
    				ugubitak = ugubitak - gubitak;
    				}
    
    		};
    			{
      srand(time(0));
    			c1 = (rand() % 40);
    			c11 = c1;
    			c2 = (rand() % 40);
    			c22 = c2;
    srand(time(0));
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31))
    			{
    				srand(time(0));
    				kv1 = 1.2 +(rand() % 2);
    			};
    		if((c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv2 = 1.4 +(rand() % 2);
    			};
    		if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39))
    			{
    				srand(time(0));
    				kv1 = 1.3 +(rand() % 3);
    			};
    		if((c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				kv2 = 1.5 +(rand() % 3);
    			};
    		if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38))
    			{
    				srand(time(0));
    				kv1 = 1.6 +(rand() % 4);
    			};
    		if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				kv2 = 1.8 +(rand() % 4);
    			};
    		if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv1 = 2 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.2 +(rand() % 2);
    			};
    			if((c1==0)||(c1==1)||(c1==9)||(c1==10)||(c1==13)||(c1==15)||(c1==16)||(c1==17)
    			||(c1==18)||(c1==19)||(c1==21)||(c1==22)||(c1==24)||(c1==32)||(c1==26)||(c1==30)
    			||(c1==33)||(c1==34)||(c1==39)
    			&& (c2==0)||(c2==1)||(c2==9)||(c2==10)||(c2==13)||(c2==15)||(c2==16)||(c2==17)
    			||(c2==18)||(c2==19)||(c2==21)||(c2==22)||(c2==24)||(c2==32)||(c2==26)||(c2==30)
    			||(c2==33)||(c2==34)||(c2==39))
    			{
    				srand(time(0));
    				kv1 = 2.1 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.3 +(rand() % 2);
    			};
    			if((c1==4)||(c1==5)||(c1==20)||(c1==23)||(c1==25)||(c1==27)||(c1==28)||(c1==29)
    			||(c1==35)||(c1==36)||(c1==37)||(c1==38)
    			&&(c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    				srand(time(0));
    				kv1 = 1.8 +(rand() % 2);
    				srand(time(0));
    				kv2 = 2.1 +(rand() % 2);
    			};
    			if((c1==2)||(c1==3)||(c1==6)||(c1==7)||(c1==8)||(c1==11)||(c1==12)||(c1==14)||(c1==31)
    			&& (c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38))
    			{
    			srand(time(0));
    				kv1 = 1.4;
    				srand(time(0));
    				kv2 = 2.1 +(rand() % 3);
    			};
    			if((c2==4)||(c2==5)||(c2==20)||(c2==23)||(c2==25)||(c2==27)||(c2==28)||(c2==29)
    			||(c2==35)||(c2==36)||(c2==37)||(c2==38)
    			&& (c2==2)||(c2==3)||(c2==6)||(c2==7)||(c2==8)||(c2==11)||(c2==12)||(c2==14)||(c2==31))
    			{
    				srand(time(0));
    				kv1 = 2.3 + (rand () % 3);
    				srand(time(0));
    				kv2 = 1.7;
    			};
    			kv3 = 2.1 + (rand() % 3);
    			}
    			if (zajam != 0)
    			{
    				renta = ((zajam * 7)/100);
    				zajam = zajam + renta;
    				counter++;
    			};
    			if (zajam == 0)
    			{
    				zajam = 0;
    				counter = 0;
    			};
    			if (counter == 5)
    			{
    			cout << "\n####### OSTALO JE 5 DANA, NAPOMENA #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "Ostalo je jos 5 dana do isplate kredita, trenutni dug je " << zajam << "$.\n";
    			};
    			if (counter == 10)
    			{
    				cout << "\n####### PROSLO JE 10 DANA, KREDIT NIJE VRACEN #######";
    			cout << "\n-------------------------------------------\n";
    			cout << "Zbog toga banka vam silom oduzima " << zajam << "$.\n";
    			novac = novac - zajam;
    			counter = 0;
    			zajam = 0;
    			};
    			timer++;
    			d++;
    			if (d == 7)
    			{
    				d = 0;
    			};
    			break;
    
    		}
    }
    	
    }

Pravila za slanje poruka

  • Ne možete kreirati novu temu
  • Ne možete poslati odgovor
  • Ne možete dodati priloge
  • Ne možete prepraviti svoju poruku
  •