From dc40f7009c9151cf5e8df0d783fb9b8bef14cf80 Mon Sep 17 00:00:00 2001 From: repitile Date: Fri, 18 Nov 2016 22:52:43 +0200 Subject: [PATCH] Create 02_domashno4.2.c --- G/04/22/02_domashno4.2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 G/04/22/02_domashno4.2.c diff --git a/G/04/22/02_domashno4.2.c b/G/04/22/02_domashno4.2.c new file mode 100644 index 000000000..c15894e9a --- /dev/null +++ b/G/04/22/02_domashno4.2.c @@ -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; + }