摘要: 话说MCA山上各路豪杰均出山抗敌,去年曾在江湖威名显赫的,江湖人称的甘露也不甘示弱,“天将降大任于斯人也,必先劳其筋骨,饿其体肤,空乏其身”他说。可惜,由于去年取上将首级时不慎右手右关节第七次骨折,养伤达一年之久,空有一腔抱负却壮志难酬,如今天下危亡,习武之人又怎能袖手旁观,于是他决定出山协助威士忌共抗辽贼,这时他的对头枫冰叶子出现,两人都是水属性,但由于十年前的一场恩怨(这是后话)势成水火。枫冰叶子要求甘露回答一个问题,否则不让他离开,可惜甘露绞尽脑汁未果,希望你来帮他解决,助他完成大业。问题是这样的:给你一个小数x,让你算出小数点后第n位是什么,(1 #includeint main(){ 阅读全文
posted @ 2014-02-22 22:02 为梦出发 阅读(355) 评论(1) 推荐(0) 编辑
摘要: gets() 函数 【1】函数:gets(字符指针) 【2】头文件:stdio.h(c中),c++不需包含此头文件 【3】原型:char *gets( char *buffer ); 【4】功能:从stdio流中读取字符串,直至接受到换行符或EOF时停止,并将读取的结果存放在buffer指针所指向的字符数组中。换行符不作为读取串的内容,读取的换行符被转换为null值,并由此来结束字符串。 【5】注意:本函数可以无限读取,不会判断上限,所以程序员应该确保str的空间足够大,以便在执行读操作时不发生溢出。如果溢出,多出来的字符将被写入到缓冲区后面的内存位置,这将破坏一个或多个... 阅读全文
posted @ 2014-02-22 15:26 为梦出发 阅读(7514) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.OutputFor each group of input integers you should output their sum in one 阅读全文
posted @ 2014-02-22 15:01 为梦出发 阅读(2041) 评论(0) 推荐(0) 编辑
摘要: Problem Description多项式的描述如下: 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + ... 现在请你求出该多项式的前n项的和。Input输入数据由2行组成,首先是一个正整数m(mint main(){int test;scanf("%d",&test);while(test--){int n,i,f=-1;double s=0; scanf("%d",&n); for(i=1;i<n+1;) { double m; f=-f; m=1.0/i*f; s+=m; i++; } printf(& 阅读全文
posted @ 2014-02-22 14:05 为梦出发 阅读(434) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give you some integers, your task is to sort these number ascending (升序). You should know how easy the prob 阅读全文
posted @ 2014-02-22 00:41 为梦出发 阅读(635) 评论(0) 推荐(0) 编辑