0
点赞
收藏
分享

微信扫一扫

AtCoder Beginner Contest 236 题解

月孛星君 2022-01-24 阅读 79
c++算法

Promlems

A - chukodai

入门题,输入字符串,交换第 a a a 位和第 b b b 位即可。

代码:

//By: Luogu@⚡炭治郎⚡(a.k.a. Kamado_Tanjiro)(LuoguID:308854)
#include <bits/stdc++.h>

using namespace std;

const int INF=(sizeof(int)==4?0x3f3f3f3f:0x3f3f3f3f3f3f3f3f);

signed main()
{
	string str;

	int a,b;

	cin>>str>>a>>b;

	swap(str[a-1],str[b-1]);

	cout<<str;
	
	return 0;
}

剩下的先咕着

举报

相关推荐

0 条评论