Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Cmxdd.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string.h>
- using namespace std;
- struct tabella
- {
- char nome[20];
- char cognome[20];
- int numero;
- };
- int main()
- {
- int i = 0;
- cout << "Inserisci la quantità di persone: ";
- cin >> i;
- struct tabella uomo[20];
- for (int j = 0; j < i; j++)
- {
- cout << "Inserisci il nome: ";
- cin.getline(uomo[j].nome, 20);
- cout << endl << "Inserisci il cognome: ";
- cin.getline(uomo[j].cognome, 20);
- cout << endl << "Inserisci il numero del cwkirejn: ";
- cin >> uomo[j].numero;
- cout << endl << endl << endl;
- }
- for (int j = 0; j < i; j++)
- {
- cout << uomo[j].numero << " " << uomo[j].nome << " " << uomo[j].cognome << endl;
- cout << "----------------------------------------------" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement