VioletaBabel

10824번: 네 수 본문

백준/백준-C++
10824번: 네 수
Beabletoet 2017. 6. 11. 22:24

#include<cstdio>

long long combine(long long q, long long w)

{

long long ten;

for (ten = 1000000; w / ten == 0; ten /= 10);

ten *= 10;

return (q*ten) + w;

}

int main()

{

long long a, b, c, d;

scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

a = combine(a, b);

c = combine(c, d);

printf("%lld", a + c);

}

'백준 > 백준-C++' 카테고리의 다른 글

11053번: 가장 긴 증가하는 부분 수열  (0) 2017.06.12
11656번: 접미사 배열  (0) 2017.06.12
11655번: ROT13  (0) 2017.06.11
10799번: 쇠막대기  (0) 2017.06.11
10818번: 최소, 최대  (0) 2017.06.11
Comments