Advertisement
F22

Untitled

F22
Jan 23rd, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. const int N=3;
  3. using namespace std;
  4. struct SDane
  5. {
  6.     string imie;
  7.     int wiek;
  8. };
  9. sortowanie(SDane *tab, SDane &tabA, SDane &tabB){
  10.     int c=0, d=0;
  11.     for(int i=0; i<N; i++)
  12.     {    
  13.         if(tab[i].wiek>18)
  14.         {
  15.            
  16.             c++;
  17.         }
  18.         if(tab[i].imie[tab[i].imie.size()-1])
  19.         {
  20.             d++;
  21.         }
  22.     }
  23.     c=0;
  24.     d=0;
  25.     for(int i=0; i<N; i++)
  26.         if(tab[i].wiek>18)
  27.         {
  28.             tabA[c]=tab[i];
  29.             c++
  30.         }
  31.     if(tab[i].imie[tab[i].imie.size()-1]='a')
  32.         {
  33.             tabB[d]=tab[i];
  34.             d++
  35.         }
  36.     }
  37. }
  38. int main()
  39. {
  40.     SDane tabA, tabB;
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement