SCHOOL07-Editorial

PROBLEM LINK:

Practice : https://www.codechef.com/problems/SCHOOL07

Contest :https://www.codechef.com/COSK19TS

Author: laks

Editorialist: laks

DIFFICULTY:

CAKEWALK.

PREREQUISITES:

Basic Knowledge of a string.

PROBLEM:

Enter the string then replace the s letters in a string by l and output the result. If you able to do that you should easy the work of teacher.

Input:

  • first line will contain the string , shows the string entered.

Output:

For each testcase, output in a single line answer given the replaced string.

Sample Input:

shakti

Sample Outut:

lakti

QUICK EXPLANATION:

In this, a problem you have to create a program in which you should enter the number containing five or not your choice and output should give change first two letters of string present in input.

EXPLANATION:

In this, you have to write code like this first, you have to write string then write for loop till the end of the string then write for i & i+1 change letter to as specified by user as shown in code.

SOLUTIONS:

[details=“Setter’s Solution”]
#include
using namespace std;

int main() {
// your code goes here
string a;
int i;
cin>>a;
for(i=0;i<a.length();i++){
if(i==2){

break;	
 }
 if(i==0)
 a[i]=' ';
 if(i==1)
 a[i]='l';
 }

cout<<a<<endl;
return 0;
}