Capobuf

Prova_Struttura_4AI

Nov 28th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <iomanip>
  4. using namespace std;
  5.       const int MAX=100;
  6.      
  7.     struct tessera
  8.     {
  9.            string nome;
  10.            string cognome;
  11.            int anno_nascita;
  12.            string squadra;
  13.            long int n_tessera;
  14.     };
  15.   int i;
  16.    
  17. int main(int argc, char *argv[])
  18. {
  19.  
  20. tessera T[MAX];
  21. int d;
  22. cout<<"Inserire numero giocatori"<<endl;
  23. cin>>d;
  24. for (i=0;i<d;i++)
  25. {
  26.     tessera calciatore;
  27.     cout<<"Inserire Nome Calciatore"<<endl;
  28.     cin>>T[i].nome;
  29.     cout<<"Inserire Cognome Calciatore"<<endl;
  30.     cin>>T[i].cognome;
  31.     cout<<"Inserire Anno di Nascita"<<endl;
  32.     cin>>T[i].anno_nascita;
  33.     cout<<"Inserire N* Tessera"<<endl;
  34.     cin>>T[i].n_tessera;                                  
  35. }  
  36. for (i=0;i<d;i++)
  37. {
  38.     cout<<endl;
  39.     cout<<endl;
  40.     cout<<endl;
  41.     cout<<setw(10)<<T[i].nome<<endl;
  42.     cout<<setw(10)<<T[i].cognome<<endl;
  43.     cout<<setw(10)<<T[i].anno_nascita<<endl;
  44.     cout<<setw(10)<<T[i].n_tessera<<endl;
  45.     cout<<endl;
  46.     cout<<endl;
  47. }
  48.     system("PAUSE");
  49.     return EXIT_SUCCESS;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment