小陈的开学第十五周代码

这篇博客介绍了Atcoder的三个编程挑战:按字符交替构造新字符串,找到满足不同嘉宾数量的零食分配最小数量,以及确定最小破碎砖块数以满足特定序列。每个问题都提供了输入输出示例和解题思路。
摘要由CSDN通过智能技术生成

1.Atcoder

1.Strings with the Same Length

题意

Given are strings s and t of length N each, both consisting of lowercase English letters.

Let us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, …, the N-th character of S, the N-th character of T. Print this new string.

输入

Input is given from Standard Input in the following format:

N
S T

1≤N≤100
|S|=|T|=N
S and T are strings consisting of lowercase English letters.

输出

Print the string formed.

样例输入1

2
ip cc

样例输出1

icpc

样例输入2

8
hmhmnknk uuuuuuuu

样例输出2

humuhumunukunuku

样例输入3

5
aaaaa aaaaa

样例输出3

aaaaaaaaaa

程序代码

//就是字符交替出现
#include<bits/stdc++.h>
using namespace std;
int main(){
   
	int n;
	cin>>n;
	char a[100+5],b[100+5];
	for(int i=0;i<n;i++){
   
		cin>>a[i];
	}
	for(int i=0;i<n;i++){
   
		cin>>b
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值