untitle

public
yousefkarem91 Sep 12, 2024 Never 79
Clone
C++ past.cpp 22 lines (22 loc) | 383 Bytes
1
#include <iostream>
2
using namespace std;
3
int main() {
4
char x,y,z;
5
cin>>x>>y>>z;
6
//RRR || SSS
7
if(x==y&&y==z&&x=='R') {
8
cout<<3;
9
}
10
else if((x==y ||y==z)&&y=='R')
11
{
12
//RRS || SRR
13
cout<<2;
14
}
15
else if(x=='R'||y=='R'||z=='R')
16
{
17
//SSR || SRS || RSS
18
cout<<1;
19
}
20
else
21
cout<<0;
22
}