- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
#include<iostream>
using namespace std;
#include<string.h>
int main()
{
int n;
int t;
char s[100];
cin>>n;
while(n!=0)
{
n--;
int TTT=0,TTH=0,THT=0,THH=0,HTT=0,HTH=0,HHT=0,HHH=0,H=0,T=0;
cin>>t;
cin>>s;
cout<<s<<"\n";
int f=0;
for(int i=0;i<strlen(s);i++)
{
if(s[i]=='T' && s[i+1]=='T' && s[i+2]=='T')
TTT+=1;
if(s[i]=='T' && s[i+1]=='T' && s[i+2]=='H')
TTH+=1;
if(s[i]=='T' && s[i+1]=='H' && s[i+2]=='T')
THT+=1;
if(s[i]=='T' && s[i+1]=='H' && s[i+2]=='H')
THH+=1;
if(s[i]=='H' && s[i+1]=='T' && s[i+2]=='T')
HTT+=1;
if(s[i]=='H' && s[i+1]=='T' && s[i+2]=='H')
HTH+=1;
if(s[i]=='H' && s[i+1]=='H' && s[i+2]=='T')
HHT+=1;
if(s[i]=='H' && s[i+1]=='H' && s[i+2]=='H')
TTT+=1;
if(s[i]=='H'){
H++;f=1;}
if(s[i]=='T'){
T++;f=1;}
}
cout<<TTT<<"\n";
if(H==40)
cout<<t<<" 0 0 0 0 0 0 0 38\n";
if(T==40)
cout<<t<<" 38 0 0 0 0 0 0 0\n";
if(f==0)
cout<<t<<" "<<TTT<<" "<<TTH<<" "<<THT<<" "<<THH<<" "<<HTT<<" "<<HTH<<" "<<HHT<<" "<<HHH<<"\n";
}
return 0;
}
daemon_master 17.05.2011 18:57 # +1
выход за пределы как бы
да и вообще херня написано
pabloid 17.05.2011 19:01 # 0
guest 19.05.2011 17:59 # 0
daemon_master 19.05.2011 19:32 # 0
Lure Of Chaos 17.05.2011 20:40 # 0
absolut 17.05.2011 20:42 # +1
bugmenot 19.05.2011 20:42 # 0
sayidandrtfm 17.05.2011 22:37 # 0
dwinner 19.05.2011 12:07 # 0
guest 19.05.2011 12:35 # −2
dwinner 19.05.2011 16:28 # 0
guest 19.05.2011 16:47 # 0
dwinner 20.05.2011 12:06 # 0
guest 20.05.2011 12:10 # +1
dwinner 20.05.2011 16:14 # 0
guest 20.05.2011 16:37 # 0
dwinner 20.05.2011 18:24 # 0
guest 20.05.2011 18:28 # 0
dwinner 20.05.2011 18:59 # 0
guest 20.05.2011 19:09 # 0
guest8 08.04.2019 20:48 # −999
guest8 09.04.2019 10:39 # −999
guest8 09.04.2019 17:57 # −999