L.冬冬解说世纪大战(ACM实验室新生赛)

模拟

#include<cstdio>
#include<iostream>
using namespace std;
 int n,m;
 string str;
 int main()
 {
     cin>>str;
     n=str.length();
     for(int i=0;i<n;i+=3)
     {
  //       printf("%c___\n",str[i]);
         if(str[i]=='S')
         {
             if(str[i+1]=='D')
                 cout<<"Hadoken ";
             else
                 cout<<"Tatsumaki Senpukyaku ";
         }
         if(str[i]=='J')
             cout<<"Denjin Renki ";
         if(str[i]=='D')
         {
             if(str[i+1]=='G')
                 cout<<"Shoulder Throw ";
             else if(str[i+1]=='H')
                 cout<<"Collarbone Breaker ";
             else if(str[i+1]=='S')
                 cout<<"Shoryuken ";
         }
         if(str[i]=='A')
             cout<<"Somersault Throw ";
         if(str[i]=='H')
             cout<<"Jodan Sanrengeki ";
     }
     cout<<endl;
     return 0;
 }
 /*
 Shoulder Throw DGB
 Somersault Throw AGB
 Collarbone Breaker DHB
 Jodan Sanrengeki HJM
 Denjin Renki JMH
 Hadoken SDG
 Shoryuken DSD
 Tatsumaki Senpukyaku SAB
 */
 

发表评论