摘要: 田忌赛马时间限制:3000ms | 内存限制:65535KB难度:3描述Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.""Both of Tian and the king have three horses in different classe 阅读全文
posted @ 2013-10-16 19:27 ABCDL 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 阶乘之和时间限制:3000ms | 内存限制:65535KB难度:3描述给你一个非负数整数n,判断n是不是一些数(这些数不允许重复使用,且为正数)的阶乘之和,如9=1!+2!+3!,如果是,则输出Yes,否则输出No;输入第一行有一个整数0=0;i--) if(n>=a[i]) n-=a[i]; 第三部: if(n==0) printf("Yes\n"); else printf("No\n")#include#define size 9int main(){ int t,n,i; int a[size]=... 阅读全文
posted @ 2013-10-16 13:36 ABCDL 阅读(208) 评论(0) 推荐(0) 编辑