summaryrefslogblamecommitdiffstats
path: root/inf/priprave/dn/1a.c
blob: 84b2c0861dfc2fadc4bcd4f436c1ea13df13dc93 (plain) (tree)

























                                                                      
#include <stdio.h>
#include <stdlib.h>
/* https://codeforces.com/group/Eu6CNrz8hK/contest/349888/problem/A */
int main (void) { /* TIL: od ISO C11 je to legalno */
	unsigned short int num1 = 9;
	unsigned short int num2 = 10;
	int c;
	while (getchar() != '\n');
	while (1) {
		if ((c = getchar()) == EOF)
			break;
		if (c == '\n')
			num2 = 9;
		if (c <= '9' && c >= '1')
#define num (*(num2 > 9 ? &num1 : &num2))
			if (c-'0' < num)
				num = c-'0';
	}
	if (num1 == num2)
		printf("%d\n", num1);
	else if (num1 < num2)
		printf("%d%d\n", num1, num2);
	else
		printf("%d%d\n", num2, num1);
	return 0;
}