Codeforces Round #386 (Div. 2), problem: (B) Decoding Solution in C/C++

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;

}

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;

}

More from author

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related posts

Advertismentspot_img

Latest posts

Anker 622 MagGo Magnetic Battery: 2026 Review, Specs & Worth-It Verdict

Anker 622 MagGo Magnetic Battery: Is the Hype Worth It in 2026? The Anker 622 MagGo Magnetic Battery has been climbing Amazon's Movers & Shakers...

Apple AirPods Pro 2 USB-C: 2026 Review, Specs & Worth-It Verdict

Apple AirPods Pro 2 USB-C: Is the Hype Worth It in 2026? The Apple AirPods Pro 2 USB-C has been climbing Amazon's Movers & Shakers...

Owala FreeSip Insulated Water Bottle 24oz: 2026 Review, Specs & Worth-It Verdict

Owala FreeSip Insulated Water Bottle 24oz: Is the Hype Worth It in 2026? The Owala FreeSip Insulated Water Bottle 24oz has been climbing Amazon's Movers...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!