摘要: 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 proble 阅读全文
posted @ 2013-04-09 23:59 cpoint 阅读(575) 评论(0) 推荐(0) 编辑
摘要: Problem Description给你2个分数,求他们的和,并要求和为最简形式。Input输入首先包含一个正整数T(T<=1000),表示有T组测试数据,然后是T行数据,每行包含四个正整数a,b,c,d(0<a,b,c,d<1000),表示两个分数a/b 和 c/d。Output对于每组测试数据,输出两个整数e和f,表示a/b + c/d的最简化结果是e/f,每组输出占一行。Sample Input21 2 1 34 3 2 3Sample Output5 62 1 1 #include<stdio.h> 2 #include<math.h> 3 阅读全文
posted @ 2013-04-09 23:16 cpoint 阅读(1326) 评论(0) 推荐(0) 编辑
摘要: Problem Description输入一个十进制数N,将它转换成R进制数输出。Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample Input7 223 12-4 3Sample Output1111B-11 1 #include <stdio.h> 2 #include <math.h> 3 #include <string.h& 阅读全文
posted @ 2013-04-09 23:00 cpoint 阅读(716) 评论(0) 推荐(0) 编辑
摘要: Problem Description有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序。Input输入数据包含多个测试实例,每组数据由两行组成,第一行是n和m,第二行是已经有序的n个数的数列。n和m同时为0标示输入数据的结束,本行不做处理。Output对于每个测试实例,输出插入新的元素后的数列。Sample Input3 31 2 40 0Sample Output1 2 3 4 1 #include <stdio.h> 2 #include <math.h> 3 #include <s 阅读全文
posted @ 2013-04-09 22:53 cpoint 阅读(773) 评论(0) 推荐(0) 编辑
摘要: Problem Description给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;Output对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。Sample Input2 1 2 32 2 2Sample OutputNOYES 1 #include<stdio.h> 2 #include<math.h> 3 #include<ctype.h> 4 #include<string.h> 5 6 阅读全文
posted @ 2013-04-09 22:14 cpoint 阅读(831) 评论(0) 推荐(0) 编辑
浏览次数:travelocity promotion codes