i)\r{printf("please input a little smallerAn");\rscanf(H%d"" /> i)\r{printf("please input a little smallerAn");\rscanf(H%d"" />

全文预览

C++经典算法100

上传者:塑料瓶子 |  格式:pdf  |  页数:52 |  大小:3296KB

文档介绍
\ri=rand() 0;\rprintf("\nplease input number you guess:\nn);\rstart=clock();\ra=time(NULL);\rscanf("%dn,&guess);\rwhilc(guess!=i)\r{if(guess>i)\r{printf("please input a little smallerAn");\rscanf(H%d",&guess);}\relse\r(printf("please input a little biggerAn1');\rscanf(',%d,',&guess);}\r)\rend=clock();\rb=time(NULL);\rprintf("\l: It took you %6.3f seconds\nn,var=(double)(end-start)/18.2);\rprintf("\l: it took you %6.3f seconds\n\n",difftime(b,a));\rif(var<15)\rprintf("\l\l You are very clever! \l\l\n\nH);\relse if(var<25)\rprintf("\l\l you are normal! \l\l\n\n");\relse\rprintf("\l\I you are stupid! \l\l\n\n");\rprintf("\l\l Congradulations \l\l\n\n");\rprintf("The number you guess is %d",i);\r1\rprintf("\ndo you want to try it again?(\"yyV .or.\,,n\'')\n");\rif((c=getch())==,y,)\rgoto loop;

收藏

分享

举报
下载此文档