早教吧 育儿知识 作业答案 考试题库 百科 知识分享

一道acm题GuessinggameSelf-AdaptTestisacomputerbasedtestthatiswidelyusedsuchasGRE,GMATandLSAT.Thetestcontinuesaccordingtohowthetest-takersperformed,whichmeans,differentanswerwouldleaddifferentquestionensue.Schoo

题目详情
一道acm题 Guessing gameSelf-Adapt Test is a computer based test that is widely used such as GRE, GMAT and LSAT. The test continues according to how the test-takers performed, which means, different answer would lead different question ensue. School of Applied Mathematics is preparing a words guessing game in concept of the Self-Adapt Test. In the game, the player could choose any word as beginning to guess the meaning. If the guessing is correct, the system would lead to a certain word while lead to another if the answer is incorrect. For instance, the first word is "abandon", if you succeed guessing it out, the next word is "abnormal"; if your guessing is wrong, the coming word is "abolish". In one word, correct answer and incorrect answer would lead different series of words following. Each word to guess has its score, and you can get the score if you guess it correctly or else you would miss it. The game can be stop whenever you like. Now the problem is, in order to gain the total scores greater or equal to T points, what's the minimum number of words you must guess out correctly? Note that each word may appear only once in the game and there's no cycle in guessing order.
▼优质解答
答案和解析
#include int compare(int b[],int c[],int b_len) //比较大整数的大小 { int p; for(p=0;c[p]!='\n';p++) p--; if (b_lenc[i]) return 0; else return 1; } } int minus(char a[],char b[],char c[],int b_len) { int n=0,p,h=0,i,j; char *A,*B,*C; A=a; B=b; C=c; for(p=0;a[p]!='\n';p++) p--; if(p=0;i--,j--) { while(j>=0) { if(*(A+i)+h>=*(B+j)) { *(C+i)=*(A+i)-*(B+j); h=0; } else { h=-1; *(C+i)=*(B+j)-*(A+i)+h; } i--; j--; } *(C+i)=*(C+i)+h; } A=C; } return n; }