现在的位置: 首页 > 综合 > 正文

HDU-3456 Universal Oracle

2013年03月24日 ⁄ 综合 ⁄ 共 337字 ⁄ 字号 评论关闭

  模拟题。

  代码如下:

#include <cstdio>
#include
<cstring>
#include
<cstdlib>
using namespace std;

char q[2000];

int main()
{
while( gets( q ) )
{
char * t, *p;
int len = strlen( q );
t
= q;
while ( 1 )
{
if( p = strchr( t, '?' ) )
{
t
= p + 1;
while( *( --p ) == ' ' ) ;
*( p + 1 ) = '\0';
while( 1 )
{
if( *( p-- ) == 't' )
{
if( *p == 'a' && *(p-1) == 'h' && *(p-2) == 'W' )
break;
}
}
printf(
"Forty-two%s.\n", p + 2 );
}
else
break;
}
}
return 0;
}

  

抱歉!评论已关闭.