Advertisement
Guest User

marzagus

a guest
Jan 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. // Cmxdd.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string.h>
  7. using namespace std;
  8. struct tabella
  9. {
  10. char nome[20];
  11. char cognome[20];
  12. int numero;
  13. };
  14. int main()
  15. {
  16. int i = 0;
  17. cout << "Inserisci la quantità di persone: ";
  18. cin >> i;
  19. struct tabella uomo[20];
  20. for (int j = 0; j < i; j++)
  21. {
  22. cout << "Inserisci il nome: ";
  23. cin.getline(uomo[j].nome, 20);
  24. cout << endl << "Inserisci il cognome: ";
  25. cin.getline(uomo[j].cognome, 20);
  26. cout << endl << "Inserisci il numero del cwkirejn: ";
  27. cin >> uomo[j].numero;
  28. cout << endl << endl << endl;
  29. }
  30. for (int j = 0; j < i; j++)
  31. {
  32. cout << uomo[j].numero << " " << uomo[j].nome << " " << uomo[j].cognome << endl;
  33. cout << "----------------------------------------------" << endl;
  34. }
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement