-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblack_friday.c
64 lines (47 loc) · 904 Bytes
/
black_friday.c
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//https://thehuxley.com/problem/468?quizId=5563
#include <stdio.h>
#define DISC 0.2
int main()
{
double n1,n2,n3,n4,n5;
double f1,f2,f3,f4,f5;
int tot = 0;
double t_d;
scanf("%lf",&n1);
scanf("%lf",&f1);
t_d = n1 - (n1*DISC);
if (f1 <= t_d)
{
tot = tot + 1;
}
scanf("%lf",&n2);
scanf("%lf",&f2);
t_d = n2 - (n2*DISC);
if (f2 <= t_d)
{
tot = tot + 1;
}
scanf("%lf",&n3);
scanf("%lf",&f3);
t_d = n3 - (n3*DISC);
if (f3 <= t_d)
{
tot = tot + 1;
}
scanf("%lf",&n4);
scanf("%lf",&f4);
t_d = n4 - (n4*DISC);
if (f4 <= t_d)
{
tot = tot + 1;
}
scanf("%lf",&n5);
scanf("%lf",&f5);
t_d = n5 - (n5*DISC);
if (f5 <= t_d)
{
tot = tot + 1;
}
printf("%d\n",tot);
return 0;
}