Time Limit: 1000 MS Memory Limit: 32768 KB
Total Submission(s): 110 Accepted Submission(s): 90
Description
You are given a string SS of length NN consisting of A
, B
and C
, and an integer KK which is between 11 and NN (inclusive). Print the string SS after lowercasing the KK-th character in it.
- 1≤N≤501≤N≤50
- 1≤K≤N1≤K≤N
- SS is a string of length NN consisting of
A
,B
andC
.
Input
Input is given from Standard Input in the following format:
NN KK SS
Output
Print the string SS after lowercasing the KK-th character in it.
Sample Input
3 1 ABC
Sample Output
aBC
Source
Unknown
key:水题
附上AC代码:
#include<bits/stdc++.h>
using namespace std;
char c,d;
int n=0,k=0,i=0;
int main()
{
cin>>n>>k;
for(i=0;i<n;i++)
{
cin>>c;
if(i==k-1)
{
d=c+32;
cout<<d;
continue;
}
cout<<c;
}
cout<<'\n';
}