上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: #include <stdio.h>#include <math.h>int main(){int i, m, n,t;int a,b,c;bool flag;while( scanf( "%d %d",&n, &m ) != EOF ){if( n > m ){t = n;n = m;m = t;}flag = false;for( i = n ; i <= m ;i++ ){a = i/100;b = (i/10);c = i;if( i == a*a*a + b*b*b + c*c*c ){if( flag == f 阅读全文
posted @ 2011-11-16 00:52 狸の舞 阅读(182) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){char str[5];int n;scanf( "%d",&n );for( ; n > 0 ; n-- ){scanf( "%s",str);if( strlen(str) > 3 )printf( "3\n" );elseif((( str[0] == 'o' ) && ( str[1] == 'n' 阅读全文
posted @ 2011-11-16 00:51 狸の舞 阅读(119) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<math.h>#include<string.h>int main(){char str[1000000];int num[30]={0}, t, i, j, k, a;while( gets( str ) ){t = strlen( str );int num[30]={0};for( i = 0; i < t; i++ ){if( str[i] >= 'a' && str[i] <= 'z' )num[ str[i] - 'a&# 阅读全文
posted @ 2011-11-16 00:50 狸の舞 阅读(153) 评论(0) 推荐(0)
摘要: #include<stdio.h>int main(){int ah,am,as,bh,bm,bs,i,k,n,zh,zm,zs;while( scanf("%d",&n) != EOF ){for ( k=0; k<n; k++ ){ah=0, am=0, as=0, bm=0, bh=0, bs=0, zm=0, zh=0, zs=0;scanf("%d %d %d %d %d %d",&ah,&am,&as,&bh,&bm,&bs);zs=as+bs;zm=am+bm;zh= 阅读全文
posted @ 2011-11-16 00:50 狸の舞 阅读(203) 评论(0) 推荐(0)
摘要: Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to sort these number ascending (升序).You should know how easy the proble 阅读全文
posted @ 2011-11-16 00:47 狸の舞 阅读(214) 评论(0) 推荐(0)
摘要: Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it slips down d inches. The process of climbing and resting then repeats. How long before the worm clim 阅读全文
posted @ 2011-11-16 00:46 狸の舞 阅读(165) 评论(0) 推荐(0)
摘要: 还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形:11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1Input输入数据包含多个测试实例,每个测试实例的输入只包含一个正整数n(1<=n<=30),表示将要输出的杨辉三角的层数。Output对应于每一个输入,请输出相应层数的杨辉三角,每一层的整数之间用一个空格隔开,每一个杨辉三角后面加一个空行。Sample Input2 3Sample Output1 1 1 1 1 1 1 2 1#include<stdio.h>int main(){int n, num[32][32 阅读全文
posted @ 2011-11-16 00:46 狸の舞 阅读(608) 评论(0) 推荐(0)
摘要: Problem Descriptionlcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody i 阅读全文
posted @ 2011-11-16 00:46 狸の舞 阅读(285) 评论(0) 推荐(0)
摘要: Problem Description参加过上个月月赛的同学一定还记得其中的一个最简单的题目,就是{A}+{B},那个题目求的是两个集合的并集,今天我们这个A-B求的是两个集合的差,就是做集合的减法运算。(当然,大家都知道集合的定义,就是同一个集合中不会有两个相同的元素,这里还是提醒大家一下)呵呵,很简单吧?Input每组输入数据占1行,每行数据的开始是2个整数n(0<n<=100)和m(0<m<=100),分别表示集合A和集合B的元素个数,然后紧跟着n+m个元素,前面n个元素属于集合A,其余的属于集合B. 每个元素为不超出int范围的整数,元素之间有一个空格隔开.如果 阅读全文
posted @ 2011-11-16 00:45 狸の舞 阅读(475) 评论(0) 推荐(0)
摘要: Description这是一个很简单的纸牌游戏——比大小。每张纸牌都有一个花色:S、H、D和C,以及有一个牌面(6\7\8\9\T\J\Q\K\A)。在游戏最开始的时候,会选择一种花色为王牌花色。游戏是这样玩的:玩家1和玩家2各出一张牌,看谁大。如果两张牌都不是王牌花色或则都是王牌花色,则牌面大的牌大,如果牌面一样大则一样大。若其中一张牌是王牌而另一张不是,则无论牌面如何都是王牌花色大。Input第一行一个数字n,代表数据组数(n <= 10)对于每组数据,首先输入一个字符(S\H\D\C),表示王牌花色。接下去一行有两张牌面,表示为牌面花色,如8D、9S等。Output对于每组数据,输 阅读全文
posted @ 2011-11-16 00:44 狸の舞 阅读(520) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 下一页