-
Notifications
You must be signed in to change notification settings - Fork 0
/
uri 1305.c
43 lines (41 loc) · 866 Bytes
/
uri 1305.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
#include <stdio.h>
int main()
{
int a, c;
float b, d;
char line[1000];
int flag = 0;
while(gets(line))
{
if(flag == 0)
{
if(sscanf(line,"%d%f", &a, &b) == 2)
{
flag = 1;
}
else if(sscanf(line,"%d.", &a) == 1)
{
b = 0;
}
else if(sscanf(line,"%f", &b) == 1)
{
a = 0;
}
else if(sscanf(line,"%d", &a) == 1)
{
b = 0;
}
flag = 1;
}
else
{
sscanf(line,"%d%f", &c, &d);
if(b > d)
printf("%d\n",a+1);
else
printf("%d\n",a);
flag = 0;
}
}
return 0;
}