Facebook
From WB, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 34
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. struct karta {
  5.         char* figure;
  6.         char* color;
  7.         int power;
  8. };
  9. char kolor[4][9] = { {"Clubs"},{"Diamonds"},{"Hearts"},{"Spades"} };
  10. char figura[13][6] = { {"Two"},{"Three"},{"Four"},{"Five"},{"Six"},{"Seven"},{"Eight"},{"Nine"},{"Ten"},{"Jack"},{"Queen"},{"King"},{"Ace"} };
  11.  
  12. int main(){
  13.         struct karta talia[52];
  14.         char* k;
  15.         k = kolor[0];
  16.         char* f;
  17.         for (int n = 0 , int count;k != NULL; k++) {
  18.                 count = 1;
  19.                 f = figura[0];
  20.                 for (; f != NULL; f++ , count++ ,n++ ) {
  21.                         talia[n].figure = f;
  22.                         talia[n].color = k;
  23.                         talia[n].power = count;
  24.                 }
  25.         }
  26.         cout << talia[0].color << endl;
  27.         cout << talia[24].power << endl;
  28.         return 0;
  29. }