-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathscan().c
More file actions
62 lines (50 loc) · 766 Bytes
/
scan().c
File metadata and controls
62 lines (50 loc) · 766 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <stdio.h>
//inline
unsigned long long scan()
{
unsigned long long z=0;
char c;
do{
c=getchar_unlocked();
} while(c<'0');
for(;c>='0';c=getchar_unlocked())
z = (z<<3) + (z<<1) + (c&15);
return z;
}
//inline
void put_uint(unsigned long long n)
{
unsigned short stack[32];
int top = 0;
do{
stack[top++] = n % 10 + '0';
n /= 10;
} while(n != 0);
while(top > 0)
putchar_unlocked(stack[--top]);
putchar_unlocked('\n');
}
//inline
int dgdum(unsigned long long n)
{
int sum = 0;
while(n)
{
sum+=n%10;
n/=10;
}
return sum;
}
int main() {
int tc;
unsigned long long n;
scanf("%d",&tc);
while(tc--)
{
int ok = 0;
n=scan();
//int dg = dgdum(n);
put_uint(n);
}
return 0;
}