forked from Userslav/uchebabezhalostna1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
35 lines (31 loc) · 876 Bytes
/
error.c
File metadata and controls
35 lines (31 loc) · 876 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
31
32
33
34
35
#include "stdio.h"
/*fsdfsdfsdf*/
int main()
{
int day=0;
int month=0;
int year=0;
printf("Input date in format: dd mm year\n\n");
scanf("%d %d %d", &day, &month, &year);
int a = (14 - month) / 12;
int y = year - a;
int m = month + 12*a - 2;
int DaysOfWeek = (7000 + (day + y + y / 4 - y / 100 + y / 400 + (31 * m) / 12)) % 7;
switch(DaysOfWeek)
{
case 0: printf("This is Sunday");
break;
case 1: printf("This is Monday");
break;
case 2: printf("This is Tuesday");
break;
case 3: printf("This is Wednesday");
break;
case 4: printf("This is Thursday");
break;
case 5: printf("This is Friday");
break;
case 6: printf("This is Saturday");
break;
}
}