随笔分类 -  南阳OJ(0难度)

南阳OJ O难度例题
摘要:话说MCA山上各路豪杰均出山抗敌,去年曾在江湖威名显赫的,江湖人称的甘露也不甘示弱,“天将降大任于斯人也,必先劳其筋骨,饿其体肤,空乏其身”他说。可惜,由于去年取上将首级时不慎右手右关节第七次骨折,养伤达一年之久,空有一腔抱负却壮志难酬,如今天下危亡,习武之人又怎能袖手旁观,于是他决定出山协助威士忌共抗辽贼,这时他的对头枫冰叶子出现,两人都是水属性,但由于十年前的一场恩怨(这是后话)势成水火。枫冰叶子要求甘露回答一个问题,否则不让他离开,可惜甘露绞尽脑汁未果,希望你来帮他解决,助他完成大业。问题是这样的:给你一个小数x,让你算出小数点后第n位是什么,(1 #includeint main(){ 阅读全文
posted @ 2014-02-22 22:02 为梦出发 阅读(379) 评论(1) 推荐(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 为梦出发 阅读(2069) 评论(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 为梦出发 阅读(451) 评论(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 为梦出发 阅读(654) 评论(0) 推荐(0)
摘要:Problem Description给定一个日期,输出这个日期是该年的第几天。Input输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。Output对于每组输入数据,输出一行,表示该日期是该年的第几天。Sample Input1985/1/202006/3/12Sample Output2071#includeint main(){int y,m,d,i;int t[]={31,28,31,30,31,30,31,31,30,31,30,31};while(scanf("%d/%d/%d& 阅读全文
posted @ 2014-02-21 23:52 为梦出发 阅读(304) 评论(0) 推荐(0)
摘要:Problem Description统计给定的n个数中,负数、零和正数的个数。Input输入数据有多组,每组占一行,每行的第一个数是整数n(nint main(){double a[100];int i,test;while(scanf("%d",&test),test){int t=0,m=0,d=0;for(i=0;i0) d++;} printf("%d %d ",t,m);printf("%d\n",d);}return 0;} 阅读全文
posted @ 2014-02-21 22:50 为梦出发 阅读(190) 评论(0) 推荐(0)
摘要:2014-01-16#includeint main(){int test;scanf("%d",&test);while(test--){int n,m;scanf("%d",&m);n=1;while(m--){n=(n+1)*2;}printf("%d\n",n);}return 0;} 阅读全文
posted @ 2014-01-16 12:10 为梦出发 阅读(125) 评论(0) 推荐(0)
摘要:2014-01-16#includeint main(){int test;char a[20];scanf("%d",&test);getchar();while(test--){gets(a);puts(a);}return 0;} 阅读全文
posted @ 2014-01-16 11:54 为梦出发 阅读(199) 评论(1) 推荐(0)