HDU-3337 Guess the number 测试输入数据

http://acm.hdu.edu.cn/showproblem.php?pid=3337

 

  这题一看没有一点头绪,题目中只说了输入数据是由大小写字母及数字组成的不超过16位的字符串,其能够表达的一个数字。我们要做的就是输出这个数字。说起来,这个真不好办,看了下大神的思路,原来是通过OJ不同的评测结果来测试后台数据,挺有意思的。  我的方法比较土,一个一个试,不知到他们所说的输入机器人是怎么弄的。一共提交了90+次,终于对了。

  这时测试时的代码:

#include <cstdio>
#include <cstring>
#include <cstdlib>
#define POS 0
using namespace std;

int test[100000000];

int down( int x )
{
return down(x);
}

int main( )
{
char ch, *p;
for( int i = 1; i <= POS; ++i )
getchar();
scanf( "%c", &ch );

if( ch == 'A' )
while( 1 )
puts( "_+_+_+_+_+" );

if( ch == 'B' )
memset( test, 0, sizeof( test ) );

if( ch == 'C' )
*p = 0;

if( ch == 'D' )
while( 1 ) ;

if( ch == 'E' )
down(2);

if( ch == 'F' )
printf( "%d\n", 1 / 0 );

else
{
printf( "WA\n" );
}
return 0;
}

    这里测试的是第一个字符。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值