摘要: Problem Description Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your luc... 阅读全文
posted @ 2015-11-05 21:23 (慎独) 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 线性筛法求素数 题目:给出一个正整数n,打印出所有从1~n的素数(即质数); 关键是要找出一个判断一个正整数n是否为素数的方法... 傻瓜解法--n,n/2 复制代码 1 #include 2 int main() 3 { 4 int i,n; 5 while(scanf("%d... 阅读全文
posted @ 2015-11-05 13:59 (慎独) 阅读(288) 评论(0) 推荐(0) 编辑
摘要: The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For... 阅读全文
posted @ 2015-11-05 13:30 (慎独) 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 难度:1 描述 编写程序,输入两个正整数x和y,求它们的最大公约数。 输入有多组测试数据,以EOF结束。 每组测试数据有2个整数x、y。输出每组数据输出一行。 样例输入 8,6 样例输出 2 注意:两个数之间需要输入一个字符; 大一没有好好搞,现在要从头搞起!!!! 代码: #include... 阅读全文
posted @ 2015-11-05 13:27 (慎独) 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ACM进阶计划 ACM队不是为了一场比赛而存在的,为的是队员的整体提高。 大学期间,ACM队队员必须要学好的课程有: C/C++两种语言 高等数学 线性代数 数据结构 离散数学 数据库原理 操作系统原理 计算机组成原理 人工智能 编译原理 算法设计与分... 阅读全文
posted @ 2015-11-05 11:38 (慎独) 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 递归方法 [cpp] view plaincopyprint? int BinSearch(int Array[],int low,int high,int key/*要找的值*/) { if (lowArray[mid]) return BinSearch(Array,mid+1,hi... 阅读全文
posted @ 2015-11-05 10:11 (慎独) 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 经常碰到字符串分割的问题,这里总结下,也方便我以后使用。 一、用strtok函数进行字符串分割 原型: char *strtok(char *str, const char *delim); 功能:分解字符串为一组字符串。 参数说明:str为要分解的字符串,delim为分隔符字符串。 返... 阅读全文
posted @ 2015-11-05 10:03 (慎独) 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 经常碰到字符串分割的问题,这里总结下,也方便我以后使用。 一、用strtok函数进行字符串分割 原型: char *strtok(char *str, const char *delim); 功能:分解字符串为一组字符串。 参数说明:str为要分解的字符串,delim为分隔符字符串。 返... 阅读全文
posted @ 2015-11-05 10:03 (慎独) 阅读(137) 评论(0) 推荐(0) 编辑