| 2 | |
| 3 | using namespace std; |
| 4 | int main() |
| 5 | { |
| 6 | string s;//to store the input string |
| 7 | getline(cin, s); |
| 8 | |
| 9 | int l=s.length( );//length of string |
| 10 | int k=0;//count of letters changed |
| 11 | for(int i=0;i<l;i++) |
| 12 | { |
| 13 | if((((i+1)%3==1)||((i+1)%3==0)) && (s[i]=='S'))//to store the number of S |
| 14 | k++; |
| 15 | if(((i+1)%3==2)&&(s[i]=='O'))//to store the number of O |
| 16 | k++; |
| 17 | } |
| 18 | cout<<s.length()-k;//the letters which is neither S nor O is our required number |
| 19 | return 0; |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected