上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: 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) 编辑
摘要: C程序的源代码中可包括各种编译指令,这些指令称为预处理命令。虽然它们实际上不是C语言的一部分,但却扩展了C程序设计的环境。本节将介绍如何应用预处理程序和注释简化程序开发过程,并提高程序的可读性。ANSI标准定义的C语言预处理程序包括下列命令:#define,#error,#include,#if,#else,#elif,#endif,#ifdef,#ifndef,#undef,#line,#pragma等。非常明显,所有预处理命令均以符号#开头,下面分别加以介绍。一 #define命令#define定义了一个标识符及一个串。在源程序中每次遇到该标识符时,均以定义的串代换它。ANSI标准将标识符 阅读全文
posted @ 2013-04-07 02:18 cpoint 阅读(656) 评论(0) 推荐(0) 编辑
摘要: C 中常用到的宏有:01: 防止一个头文件被重复包含#ifndef COMDEF_H#define COMDEF_H//头文件内容#endif02: 重新定义一些类型防止由于各种平台和编译器的不同,而产生的类型字节数差异,方便移植。typedef unsigned char boolean; /* Boolean value type. */typedef unsigned long int uint32; /* Unsigned 32 bit value */typedef unsigned short uint16; /* Unsigned 16 bit value */typedef u 阅读全文
posted @ 2013-04-05 23:03 cpoint 阅读(680) 评论(0) 推荐(0) 编辑
摘要: Big NumberProblem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.In 阅读全文
posted @ 2013-02-17 10:04 cpoint 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 int main() 3 { 4 int c,nl; 5 nl=0; 6 while((c=getchar())!=EOF) 7 { 8 if(c=='\n') 9 ++nl;10 }11 printf("%d\n",nl);12 13 }*/14 15 16 #include<stdio.h>17 #include<stdlib.h>18 19 void main()20 {21 int c,nl,space_n;22 nl... 阅读全文
posted @ 2013-01-20 15:15 cpoint 阅读(2558) 评论(0) 推荐(0) 编辑
摘要: 只要是对计算机有了解的同学一定都知道字节有如下换算关系:1 byte (B) = 8 bits (b) 字节=8个二进制位 1 Kilobyte(K/KB)=210 bytes=1,024 bytes 千字节 1 Megabyte(M/MB)=220 bytes=1,048,576 bytes 兆字节 1 Gigabyte(G/GB)=230 bytes=1,073,741,824 bytes 千兆字节 1 Terabyte(T/TB)=240 bytes=1,099,511,627,776 bytes吉字节 当然,如果你在学习计算机网络或是组成原理CPU等的传输率的时候,会经常出现如下单位: 阅读全文
posted @ 2012-11-30 23:05 cpoint 阅读(357) 评论(0) 推荐(0) 编辑
摘要: •Multiple instances.•Each process must a priori claim maximum use.•When a process requests a resource it may have to wait. •When a process gets all its resources it must return them in a finite amount of time.n为进程的数目,m为资源类型的数目•Available: Vector of length m.–If available [j] = k, there are k instance 阅读全文
posted @ 2012-11-18 22:59 cpoint 阅读(1325) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
浏览次数:travelocity promotion codes