#include #include int main() { int i; struct Studente{ char nome[30]; char cognome[30]; int annoNascita; int voto1; int voto2; int voto3; }; struct Studente studente1; struct Studente studente2; // studente1.nome = "Antonio"; <- NO ! strcpy(studente1.nome, "Antonio"); strcpy(studente1.cognome, "Persichetti"); studente1.annoNascita = 1999; studente1.voto1 = 30; studente1.voto2 = 31; studente1.voto3 = 28; strcpy(studente2.nome, "Daniele"); strcpy(studente2.cognome, "Zurlo"); studente2.annoNascita = 1997; studente2.voto1 = 23; studente2.voto2 = 18; studente2.voto3 = 14; printf("%s %s (%d): %d %d %d \n", studente1.nome, studente1.cognome, studente1.annoNascita, studente1.voto1, studente1.voto2, studente1.voto3); printf("%s %s (%d): %d %d %d \n", studente2.nome, studente2.cognome, studente2.annoNascita, studente2.voto1, studente2.voto2, studente2.voto3); struct Studente altri[10]; strcpy(altri[0].nome, "Giuseppe"); strcpy(altri[0].cognome, "Garibaldi"); altri[0].annoNascita = 1999; altri[0].voto1 = 23; altri[0].voto2 = 18; altri[0].voto3 = 14; strcpy(altri[1].nome, "Giuseppe"); strcpy(altri[1].cognome, "Mazzini"); altri[1].annoNascita = 1999; altri[1].voto1 = 18; altri[1].voto2 = 19; altri[1].voto3 = 20; strcpy(altri[2].nome, "Alessandro"); strcpy(altri[2].cognome, "Manzoni"); altri[2].annoNascita = 2000; altri[2].voto1 = 30; altri[2].voto2 = 30; altri[2].voto3 = 30; puts("\nAltri:"); for(i=0; i<3; i++) { printf("%s %s (%d): %d %d %d \n", altri[i].nome, altri[i].cognome, altri[i].annoNascita, altri[i].voto1, altri[i].voto2, altri[i].voto3); } puts("\nAltra stampa:"); for(i=0; i<10; i++) { printf("%s %s (%d): %d %d %d \n", altri[i].nome, altri[i].cognome, altri[i].annoNascita, altri[i].voto1, altri[i].voto2, altri[i].voto3); } }