水仙花数

问题描述 水仙花数是一个三位数,其各位数字立方和等于数本身。例如,153是一个水仙花数,因为153=。你的任务是判断一个数n是否是水仙花数。 输入 输入文件有若干行,每一行上有一个整数n,(1<=n<=999)。 输出 输出文件有若干行。对输入文件中的每个整数n,在一行上输出该数字,加上“YES”或“NO”,中间用冒号隔离开。如果数n是水仙花数,那么输出“YES”,否则输出“NO”。 输入样例 153100 输出样例 153:YES100:NO
2006-10-22 10:58 | 阅读 2948 次 | 评论 0 条

完全数

问题描述 一个数n如果恰好等于它的真因子之和,那么这个数就称为完全数。例如,6是一个完全数,因为6=1+2+3。你的任务是判断一个数n是否是完全数。输入 输入文件有若干行,每一行上有一个整数n,(1<=n<=65535)。输出 输出文件有若干行。对输入文件中的每个整数n,先输出数n, 接着空一格后输出“YES”或“NO”,如果数n是完全数,那么输出“YES”,否则输出“NO”。输入样例36输出样例3 NO6 YES
2006-10-22 10:46 | 阅读 1963 次 | 评论 0 条

A+B Problam

Description:Calculate a + b Input:The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line, 0 0 means the end of the input, and do not need to output. Output:For each pair of input integers a and b you should output the sum of a a...
2006-10-22 10:34 | 阅读 1434 次 | 评论 0 条

图的最短路径算法

今天老师讲了图搜索算法,搞的我一头模糊,什么也听不懂.白白浪费了许多时间.现在我把这个程序放在这如果你会的话指导我一下啊.谢谢了 #include <stdio.h>#include <math.h> #define BOOL int#define TRUE 1#define FALSE 0#define MAXN 80struct node{ int row; int col; struct node * parent; struct node * next; double g_value; double f_value;};struct node *close,...
2006-06-03 19:36 | 阅读 10809 次 | 评论 0 条
浏览107769次