Untitled

mail@pastecode.io avatar
unknown
c_cpp
14 days ago
375 B
0
Indexable
Never
using namespace std;
#include <iostream>

string stroka(string str, int a, int b) {
	int n = str[a];
	int n2 = str[b];
	str[a] = n2;
	str[b] = n;
	return str;

}



int main()
{
	//                       popa >> oppa    //
	string str;
	cin >> str;
	int a, b;
    cin >> a >> b;
	a-=1;
	b-=1;
	cout << stroka(str, a, b);
	                        
}
Leave a Comment