Jak to zapisac

0

Mam problem bo chce zapisac to w funkcji ale wyskakuje mi blad

int prawda;
void nazwa()
{
`int firstcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum + 4);
}

int secondcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum + 2);
}

int thirdcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum - 7);
}

int fourcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum) + minimum + 1;
}
int fivecard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum ) + 5;
    string blad = "BLAD";
   switch(firstcard(54,1))
   {
        case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }

      switch(secondcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
      switch(thirdcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
      switch(fourcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }

      switch(fivecard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
}
2

ale wyskakuje mi blad

Jaki błąd?

1

error: a function-definition is not allowed here before '{' token

taki blad

1


1

Definiujesz funkcję wewnątrz funkcji

int prawda;
void nazwa()
{
int firstcard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum + 4);
}
1

chcĘ podkreslic ze sie dopiero ucze

1

nie rozumiem mozesz mi wytlumaczyc

Nie możesz definiować funkcji wewnątrz innej funkcji. Wskazałem Ci miejsce w którym to się dzieje.

1

a jak juz o programowaniu to powie mi ktos co zrobic by mi sie ta funkcja int aktalizowala

0
#include <iostream>
#include <ctime>
#include <cstdlib>

using namespace std;


int firstcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum + 4);
}

int secondcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum + 2);
}

int thirdcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum - 7);
}

int fourcard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum) + minimum + 1;
}
int fivecard(int maximum, int minimum)
{
    srand(time( NULL ) );
	return rand() % (maximum - minimum ) + 5;
}
string blad = "BLAD";
int prawda;
void nazwa()
{
    firstcard(54,1);
    secondcard(54,1);
    thirdcard(54,1);
    fourcard(54,1);
    fivecard(54,1);
    switch(firstcard(54,1))
   {
        case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }

      switch(secondcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
      switch(thirdcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
      switch(fourcard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }

      switch(fivecard(54,1))
   {
                case 1:
            cout << "AS KIER\n";
            break;
        case 2:
            cout << "2 KIER\n";
            break;
        case 3:
            cout << "3 KIER\n";
            break;
        case 4:
            cout << "4 KIER\n";
            break;
        case 5:
            cout << "5 KIER\n";
            break;
        case 6:
            cout << "6 KIER\n";
            break;
        case 7:
            cout << "7 KIER\n";
            break;
        case 8:
            cout << "8 KIER\n";
            break;
        case 9:
            cout << "9 KIER\n";
            break;
        case 10:
            cout << "10 KIER\n";
            break;
        case 11:
            cout << "WALET KIER\n";
            break;
        case 12:
            cout << "KROLOWA KIER\n";
            break;
        case 13:
            cout << "KROL KIER\n";
            break;
        case 14:
            cout << "AS PIK\n";
            break;
        case 15:
            cout << "2 PIK\n";
            break;
        case 16:
            cout << "3 PIK\n";
            break;
        case 17:
            cout << "4 PIK\n";
            break;
        case 18:
            cout << "5 PIK\n";
            break;
        case 19:
            cout << "6 PIK\n";
            break;
        case 20:
            cout << "7 PIK\n";
            break;
        case 21:
            cout << "8 PIK\n";
            break;
        case 22:
            cout << "9 PIK\n";
            break;
        case 23:
            cout << "10 PIK\n";
            break;
        case 24:
            cout << "WALET PIK\n";
            break;
        case 25:
            cout << "KROLOWA PIK\n";
            break;
        case 26:
            cout << "KROL PIK\n";
            break;
        case 27:
            cout << "AS TREFL\n";
            break;
        case 28:
            cout << "2 TREFL\n";
            break;
        case 29:
            cout << "3 TREFL\n";
            break;
        case 30:
            cout << "4 TREFL\n";
            break;
        case 31:
            cout << "5 TREFL\n";
            break;
        case 32:
            cout << "6 TREFL\n";
            break;
        case 33:
            cout << "7 TREFL\n";
            break;
        case 34:
            cout << "8 TREFL\n";
            break;
        case 35:
            cout << "9 TREFL\n";
            break;
        case 36:
            cout << "10 TREFL\n";
            break;
        case 37:
            cout << "WALET TREFL\n";
            break;
        case 38:
            cout << "KROLOWA TREFL\n";
            break;
        case 39:
            cout << "KROL TREFL\n";
            break;
        case 40:
            cout << "AS KARO\n";
            break;
        case 41:
            cout << "2 KARO\n";
            break;
        case 42:
            cout << "3 KARO\n";
            break;
        case 43:
            cout << "4 KARO\n";
            break;
        case 44:
            cout << "5 KARO\n";
            break;
        case 45:
            cout << "6 KARO\n";
            break;
        case 46:
            cout << "7 KARO\n";
            break;
        case 47:
            cout << "8 KARO\n";
            break;
        case 48:
            cout << "9 KARO\n";
            break;
        case 49:
            cout << "10 KARO\n";
            break;
        case 50:
            cout << "WALET KARO\n";
            break;
        case 51:
            cout << "KROLOWA KARO\n";
            break;
        case 52:
            cout << "KROL KARO\n";
            break;
        case 53:
            cout << "JOKER CZERWONY\n";
            break;
        case 54:
            cout << "JOKER CZARNY\n";
            break;
        default:
            cout << blad <<'\n';
            prawda = 1;
            break;
   }
}
int main()
{
     nazwa();
     if ( firstcard(54,1) == secondcard(54,1) || firstcard(54,1) == thirdcard(54,1) || firstcard(54,1) == fourcard(54,1) || firstcard(54,1) == fivecard(54,1) || secondcard(54,1) == thirdcard(54,1) || secondcard(54,1) == fourcard(54,1) || secondcard(54,1) == fivecard(54,1) || thirdcard(54,1) == fourcard(54,1) || thirdcard(54,1) == fivecard(54,1) || fourcard(54,1) == fivecard(54,1) )
     {
        cout << '\n';
        nazwa();
     }
     if ( prawda == 1)
     {
         cout << '\n';
         nazwa();
     }
}


0

Popatrz, tak to zrób:
c++ Tutaj wklejasz swój kod

1 użytkowników online, w tym zalogowanych: 0, gości: 1