-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathCalendario.cpp
More file actions
30 lines (23 loc) · 776 Bytes
/
Calendario.cpp
File metadata and controls
30 lines (23 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
main()
{
int scelta=7, counter, giorni;
do{printf("Che giorno e' il primo del mese?");
printf("\n0) Lun\n1) Mar\n2) Mer\n3) Gio\n4) Ven\n5) Sab\n6) Dom");
printf("\nInserire la scelta: ");
scanf("%d",&scelta);
printf("\n\n");}while(scelta>6);
counter=scelta;
printf("\n\n Lun Mar Mer Gio Ven Sab Dom\n");
while(scelta>0){
scelta--;
printf(" ");
}
for(giorni = 1; giorni < 32; giorni++){
printf("%4d",giorni);
if((giorni+counter)%7==0)printf("\n");
}
fflush(stdin);
getchar();
return 0;
}