Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. struct pacjenci{
  7.     string imie;
  8.     int ID,wiek,waga;
  9. };
  10.  
  11.  
  12. int main()
  13. {
  14.    pacjenci dane[50];
  15.     int ip;
  16.     cout << "Podaj ilu bedzie pacjentow" << endl;
  17.     cin >> ip;
  18.     for (int i=0; i<ip;i++){
  19.  
  20.         cout<<"podaj informacje o pacjencie nr: " <<i+1<<endl;
  21.  
  22.         cout << "podaj imie pacjenta  ";
  23.         cin>>dane[i].imie;
  24.         cout<<endl;
  25.         cout << "podaj wiek pacjenta  ";
  26.         cin>>dane[i].wiek;
  27.         cout<<endl;
  28.         cout<<"podaj wage pacjenta  ";
  29.         cin >>dane[i].waga;
  30.         dane[i].ID==i;
  31.         cout<<endl;
  32. }
  33.     for (int i=0;i<ip;i++){
  34.         cout<<"dane o pacjencie nr "<<i+1<<":"<<endl;
  35.         cout<<"Imie:"<<dane[i].imie<<endl;
  36.         cout<<"Wiek:"<<dane[i].wiek<<endl;
  37.         cout<<"Waga:"<<dane[i].waga<<endl<<endl;
  38.  
  39.     }
  40.  
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement