- 2
https://www.sololearn.com/coach/16?ref=app
Please give the solution
2 Antworten
+ 4
First try from your side. Code Coach Problems are for you to learn Programming.
0
#include <iostream>
using namespace std;
int main() {
int i=1;
char sentence[80];
//input
int k=0;
while(sentence[k]!='\n')
{
cin>>sentence[k];
}
//output
int j=0;
while(sentence[i]!='\n')
{
for( j=i; sentence[j]!='\0'; j++)
cout<<sentence[j];
cout<<sentence[i-1]<<"ay ";
i=j+2;
}
return 0;
}
I have tried this. It shows no output in result.