-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuva-10055.cpp
More file actions
38 lines (27 loc) · 784 Bytes
/
uva-10055.cpp
File metadata and controls
38 lines (27 loc) · 784 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
36
37
38
#include <bits/stdc++.h>
using namespace std;
void fastScan(unsigned long long &number);
int main()
{
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
unsigned long long x, y;
char c;
while ((c = getchar_unlocked()) != EOF) {
ungetc(c, stdin);
fastScan(x);
fastScan(y);
printf("%llu\n", x >= y ? x - y : y - x);
}
return 0;
}
void fastScan(unsigned long long &number)
{
register unsigned long long c;
number = 0;
/// Keep on extracting characters if they are integers
/// i.e ASCII Value lies from '0'(48) to '9' (57)
for (c = getchar_unlocked(); (c > 47 && c < 58); c = getchar_unlocked()) {
number = number * 10 + c - 48;
}
}