摘要: #include<stdio.h>main(){ int n,x,k,q,p,a,b,c; scanf("%d",&n); while(n--) { scanf("%d%d",&x,&k); for(p=0;p<1000;p++) for(q=0;q<1000;q++) { a=(p*(x/k)); b=(q*(x/k)); c=a+b; if(x==c) goto e; } e: printf("%d %d",p,q); }} 阅读全文
posted @ 2013-02-24 22:39 王文城 阅读(330) 评论(0) 推荐(0) 编辑
摘要: #include main() { float c,bi,n,a[1000],av,m=0; int i; scanf("%f",&c); while(c--) { scanf("%f",&n); for(i=0;iav) m+=1; bi=m/n; bi=bi*100; printf("%0.3f",bi); printf("%%\n"); } } 阅读全文
posted @ 2013-02-24 21:23 王文城 阅读(452) 评论(0) 推荐(0) 编辑
摘要: All in AllInput:standard inputOutput:standard outputTime Limit:2 secondsMemory Limit:32 MBYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail 阅读全文
posted @ 2013-02-24 20:30 王文城 阅读(212) 评论(0) 推荐(0) 编辑
摘要: BackgroundProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.The ProblemConsider the following algo 阅读全文
posted @ 2013-02-24 16:29 王文城 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Input:standard inputOutput:standard outputA particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?InputThe input will contain two integers in each line. Each line makes one set of input. These two int 阅读全文
posted @ 2013-02-24 16:06 王文城 阅读(224) 评论(0) 推荐(0) 编辑
摘要: In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed 阅读全文
posted @ 2013-02-24 15:46 王文城 阅读(317) 评论(0) 推荐(0) 编辑
摘要: Everybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInput to your program will consist of a series of lines, each line containing multiple words (at least one). A ``word'' is d 阅读全文
posted @ 2013-02-24 15:14 王文城 阅读(303) 评论(0) 推荐(0) 编辑
摘要: nput:standard inputOutput:standard outputHashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and the opponent's soldier number. From 阅读全文
posted @ 2013-02-24 14:53 王文城 阅读(124) 评论(0) 推荐(0) 编辑
摘要: The medieval interest in mechanical contrivances is well illustrated by the development of the mechanical clock, the oldest of which is driven by weights and controlled by a verge, an oscillating arm engaging with a gear wheel. It dates back to 1386.Clocks driven by springs had appeared by the mid-1 阅读全文
posted @ 2013-02-22 17:01 王文城 阅读(236) 评论(0) 推荐(0) 编辑