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

How Viral Kitchen Gadgets Is Quietly Changing the Game

📢 As an Amazon Associate, I earn from qualifying purchases.If you had told me six months ago that a single purchase would change how...

Is Viral Kitchen Gadgets Worth Your Money Here Is Our Full Review

📢 As an Amazon Associate, I earn from qualifying purchases.There comes a point when you realise that tolerating a frustrating situation is costing you...

Putin approves takeover of French and Swiss giants’ Russian assets. Why now?

In a major development regarding foreign corporate ownership in Russia, President Vladimir Putin has authorized a decree placing the local subsidiaries of prominent Swiss...

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!