From 6a6f2a3b315224f7854de28ad7dd6a0aa12282d6 Mon Sep 17 00:00:00 2001 From: repitile Date: Fri, 18 Nov 2016 22:28:09 +0200 Subject: [PATCH] Create 02_domashno --- G/04/02_domashno | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 G/04/02_domashno diff --git a/G/04/02_domashno b/G/04/02_domashno new file mode 100644 index 000000000..c15894e9a --- /dev/null +++ b/G/04/02_domashno @@ -0,0 +1,20 @@ +#include + int main() + { + int n; + scanf("%d", &n); + int mas[n],i=0,p,b; + do + { + scanf("%d", &mas[i]); + if(mas[i]%2!=0) + i++; + }while(n>i); + for(p=0,i=n-1;i>=p;p++,i--){ + if(i!=p){ + b=mas[p]-mas[i]; + printf("%d\n" ,b);} + else printf("%d", mas[p]); + } + return 0; + }