Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
Codeforces Round #386 (Div. 2), problem: (B) Decoding Solution in C/C++
#include<stdio.h>
int main(){
int n,i;char a[2001];
scanf("%d",&n);
scanf("%s",a);
n-=1;
for(i=n-1;i>=0;i-=2)
{ printf("%c",a[i]);
}
if(n%2==0)
i=0;
else
i=1;
for(i;i<=n;i+=2)
printf("%c",a[i]);
return 0;
}
📦 Looking for Codeforces Round 386 Div Problem Decoding? Check the best deals on Amazon.
🛒 Shop Codeforces Round 386 Div Problem Decoding on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.
Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
Codeforces Round #386 (Div. 2), problem: (B) Decoding Solution in C/C++
#include<stdio.h>
int main(){
int n,i;char a[2001];
scanf("%d",&n);
scanf("%s",a);
n-=1;
for(i=n-1;i>=0;i-=2)
{ printf("%c",a[i]);
}
if(n%2==0)
i=0;
else
i=1;
for(i;i<=n;i+=2)
printf("%c",a[i]);
return 0;
}
📦 Looking for Codeforces Round 386 Div Problem Decoding? Check the best deals on Amazon.
🛒 Shop Codeforces Round 386 Div Problem Decoding on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.