上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1108和1019感觉很类似,都是求最小公倍数的题目,可是1019题目上给的数据能够通过,可是老是WA,待解决。#includeint gcd(int a,int b){ int t,r; if(a<b) ... 阅读全文
posted @ 2014-11-06 19:52 sequenceaa 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2001注意输入时候的空格就可以了#include#includeint main(){ double x1,x2,y1,y2; while(scanf("%lf %lf %lf %lf",&x1,&y1,... 阅读全文
posted @ 2014-11-06 19:37 sequenceaa 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2000注意过滤掉输入三个字符之后的回车键即可#includeint main(){ char a,b,c,t; while(scanf("%c%c%c",&a,&b,&c)!=EOF) { getcha... 阅读全文
posted @ 2014-11-05 18:13 sequenceaa 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003题目意思:即给出一串数据,求连续的子序列的最大和解题思路:因为我们很容易想到用一个max来存放找到的子序列的和中的最大值,通过不断比较,对max的值进行更新,最后我们就能够得到最大子序列的和,于是很... 阅读全文
posted @ 2014-11-03 21:46 sequenceaa 阅读(1008) 评论(0) 推荐(0) 编辑
摘要: 这一题目是要求连续子序列的最大和,所以在看到题目的一瞬间就想到的是把所有情况列举出来,再两个两个的比较,取最大的(即为更新最大值的意思),这样的思路很简单,但是会超时,时间复杂度为O(n^3),因为有三重for语句#include#define maxn 101000int main(){ int ... 阅读全文
posted @ 2014-11-03 00:33 sequenceaa 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 第一次提交的时候,有一个小的毛病,就是在第二个for循环中没有再定义i,后来百度才知道这个错误是因为在当前for循环里面直接定义了i,i的作用范围就只在这一个for循环里面,如果在下一个for循环里面之间用i,就会报错下面是更改后的代码#includeint max(int a,int b){ ... 阅读全文
posted @ 2014-11-01 06:48 sequenceaa 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 对"black,green,yellow,pin,red"几个单词排序01#include #include void sort(char (*p)[20],int n){ char *q; char b[20]; q=b; int i,j; for(i=0;i0) { strcpy(q,... 阅读全文
posted @ 2014-10-31 13:23 sequenceaa 阅读(466) 评论(0) 推荐(0) 编辑
摘要: 这是自己敲出的代码,现在还输不出结果,记录下来,待修改。#includeint max(int a,int b){ if(a>=b) return a; else return b;}int main(){ int t,num,k,a[105][105]; scanf("%d",&t); w... 阅读全文
posted @ 2014-10-31 06:24 sequenceaa 阅读(189) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/chocolate_22/article/details/6458029觉得总结得挺好的 阅读全文
posted @ 2014-10-30 00:22 sequenceaa 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 终于知道自己错在哪儿了,题目给的都是大写的字母O还有X,而我一直用的是小写的去判断,下面是修改过的通过的。#includeint main(){ int i,t; char a[100]; scanf("%d",&t); while(t--) { scanf("%s",&a); int... 阅读全文
posted @ 2014-10-29 07:27 sequenceaa 阅读(220) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页