-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12555.cpp
More file actions
34 lines (34 loc) · 781 Bytes
/
12555.cpp
File metadata and controls
34 lines (34 loc) · 781 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
#include <bits/stdc++.h>
using namespace std;
#define mem(x, y) memset(x, y, sizeof(x));
int main() {
char a[10];
int i, j = 0, flag, k, m, l, n, t;
double sum;
scanf("%d", &t);
getchar();
while (t--) {
flag = 0;
j++;
gets(a);
l = strlen(a);
l--;
n = 0;
m = 0;
i = 0;
while (a[i] != 0) {
if (a[i] >= '0' && a[i] <= '9') {
if (flag == 0) {
m = m * 10 + a[i] - '0';
} else {
n = n * 10 + a[i] - '0';
}
} else
flag = 1;
i++;
}
sum = 0.5 * (double)m + 0.05 * (double)n;
printf("Case %d: %g\n", j, sum);
}
return 0;
}