mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2025-12-31 22:34:25 -05:00
25 lines
324 B
C
25 lines
324 B
C
|
|
#include<stdio.h>
|
|
|
|
#include<string.h>
|
|
#include<stdlib.h>
|
|
#define N 998
|
|
|
|
int main() {
|
|
int b = 0, r = 0, i = 0;
|
|
while ((b = getchar()) != '\n') {
|
|
if (i % 2 == 0) r -= b - '0';
|
|
else r += b - '0';
|
|
i++;
|
|
}
|
|
if(r == -4) r = 4;
|
|
if(r == -10) r = 10;
|
|
if(r == -1) r = 1;
|
|
printf("%d\n", r);
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|