-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11921.cpp
More file actions
43 lines (40 loc) · 857 Bytes
/
Copy path11921.cpp
File metadata and controls
43 lines (40 loc) · 857 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
#include <cstdio>
using namespace std ;
char a[50000000] ;
int main()
{
int N = 0, i, temp ;
long long sum = 0 ;
printf(0b1111)
fread(a, 1, sizeof(a), stdin) ;
for(i = 0 ; a[i] != '\n' ; i++) N = N * 10 + (a[i] - 0x30) ;
printf("%d\n", N) ;
while(N--)
{
temp = 0 ;
for(i++ ; a[i] != '\n' ; i++) temp = temp * 10 + (a[i] - 0x30) ;
sum += temp ;
}
printf("%d\n", sum) ;
}
// inline int Converter()
// {
// register int b = 0 ;
// register char c ;
// while((c = getchar()) != '\n')
// {
// b = (b*10) + c - 0x30 ;
// }
// return b ;
// }
// int main()
// {
// register long long int a = 0 ;
// register int T = Converter() ;
// printf("%d\n", T) ;
// while(T--)
// {
// a += Converter() ;
// }
// printf("%d", a) ;
// }