CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
using namespace std;
int main() {
string Floor;//= "xGxTGxx$xGxTxG";
//"xxxGGxx$xxGxxT" "xxxGxxx$xxxT";
cin>>Floor;
//getline(cin,Floor);
int Count=0;
int TRcounter=0;
int TLcounter=0;
bool G= true;
bool T= true;
for(size_t ch =0; ch<Floor.length(); ch++ ){
//checks the position of $
if(Floor[ch] =='$'){
Count=ch;
}}
for(size_t ch =Count; ch<Floor.length(); ch++ ){
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run