上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 27 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1228题目很简单,不过自己写的代码很繁,先判断加号前面的,判断时可以通过空格的数量来计算数字的多少,然后判断加号后面,等号前面的#include<stdio.h>#include<string.h>int main(){ int n,a,b,i,j,sum; char str[11][10]={"zero","one","two","three","four","five&qu 阅读全文
posted @ 2013-05-28 20:25 执着追求的IT小小鸟 阅读(192) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1229这题,是我想多了ac代码#include<stdio.h>int main() // 代码一AC{ const int right[8] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000}; int a, b, k; while (scanf("%d%d%d", &a, &b, &k) != EOF && (a != 0 || b != 0)) { if (a % right 阅读全文
posted @ 2013-05-28 17:02 执着追求的IT小小鸟 阅读(121) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1124由前几个可以知道,总共数里面含有几个5,就有几个0#include<stdio.h>int main(){ __int64 f,sum;int t;scanf("%d",&t);while(t--){sum=0;scanf("%I64d",&f);while(f){f/=5;sum+=f;}printf("%I64d\n",sum);}return 0;} 阅读全文
posted @ 2013-05-27 23:16 执着追求的IT小小鸟 阅读(121) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1205思路:只要除了数目最多的糖果以外的其他所有糖果的数目之和加1(小心这里要用int64),大于等于数目最多的糖果数,就能吃完,否则不能。#include<stdio.h>int main(){ __int64 n,x,sum,max,t,i; scanf("%I64d",&t); while(t--) { scanf("%I64d",&n); max=sum=0; for(i=0;i<n;i++) { scanf("... 阅读全文
posted @ 2013-05-27 20:13 执着追求的IT小小鸟 阅读(213) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1048按题目中给出的数据对号入座就好,特别注意F对应的是A#include<stdio.h>#include<string.h>int main(){ char s[1000],start[100],end[100],c[10]; int i; while(scanf("%s",start),strcmp(start,"ENDOFINPUT")) { gets(c); gets(s); gets(end); for(i=0;s[i]!=' 阅读全文
posted @ 2013-05-27 19:19 执着追求的IT小小鸟 阅读(182) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1517#include<stdio.h>int main(){ double n,a; while(scanf("%lf",&a)!=EOF) { n=1; while(1) { n*=9; if(n>=a) { printf("Stan wins.\n"); break; } n*=... 阅读全文
posted @ 2013-05-25 22:02 执着追求的IT小小鸟 阅读(129) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1715大菲波数,用大数相加来做,打表后查表#include<stdio.h>int f[1010][300];int main(){ int i,j,n,t; scanf("%d",&t); f[2][0]=f[1][0]=1; for(i=3;i<1001;i++) { for(j=0;j<300;j++) f[i][j]=f[i-1][j]+f[i-2][j]; for(j=0;j<300;j++) if(f[i][j]>9... 阅读全文
posted @ 2013-05-24 22:32 执着追求的IT小小鸟 阅读(127) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1859只要挑出各个坐标最大的就可以了#include<stdio.h>int main(){ int m,n,x1,y1,x2,y2; while(scanf("%ld %ld",&m,&n)&&(m||n)) { x1=x2=m; y1=y2=n; while(scanf("%ld %ld",&m,&n)&&(m||n)) { if(x1<m) x1=m; if(y1<n) y1= 阅读全文
posted @ 2013-05-23 23:57 执着追求的IT小小鸟 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1327就是变量之间的赋值而已,刚开始a有赋值,其他没有,根据下面的代码,输出程序运行后又被赋值的所有字母,题目看半天。。。。。。#include <stdio.h>int main(){ char let[26]; char line[6]; int n,i,j,k,ca; ca=1; while(scanf("%d",&n)&&n){ getchar(); for(i=0;i<26;i++) let[i]='0'; ... 阅读全文
posted @ 2013-05-23 21:26 执着追求的IT小小鸟 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1306这题就是通过两个字符串的依次移动,然后求出对应字符相等的最大的那个数,题目中的例子可以较清楚的理解,在输出的地方注意,当这个数为0时直接输出0而非分数,当然这个数的两倍和两字符串长度和相等时,输出的也是1而不是分数,然后如果输出的一定得是分数时,先用辗转相除法求出最大公约数,再将之转化为两个互质的分子和分母,这题感觉很悲剧,居然暴力的代码也能0ms过#include<stdio.h>#include<string.h>int huzhi(int a,int b){ int r=a 阅读全文
posted @ 2013-05-23 18:16 执着追求的IT小小鸟 阅读(206) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 27 下一页