Q

백준 3003

백준 3003번 문제


C code

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
#include <stdio.h>
#define SIZE 6

int main(void)
{
int chessman[SIZE] = {1, 1, 2, 2, 2, 8};
int input;

for(int i = 0; i < SIZE; i++)
{
scanf("%d", &input);

if(input < 0 && input > 10)
return 0;

/*
if(input > chessman[i])
printf("%d ", -(input - chessman[i]));
else if(input < chessman[i])
printf("%d ", chessman[i] - input);
else
printf("0 ");
*/

printf("%d ", chessman[i] - input);
}

return 0;
}