izaberina

mesi v2

Jan 11th, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. struct mese {
  4.     int num;
  5.     string nome;
  6. };
  7. main () {
  8.     mese lungh[12] = {{31,"gennaio"},{28,"febbraio"},{31,"marzo"},{30,"aprile"},{31,"maggio"},{30,"giugno"},{31,"luglio"},{31,"agosto"},{30,"settembre"},{31,"ottobre"},{30,"novembre"},{31,"dicembre"}};
  9.     for (int i = 0; i < 12; i++) {
  10.         for (int j = 1; j <= lungh[i].num; j++) {
  11.             cout << j << " " << lungh[i].nome << endl;
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment