上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: #include<stdio.h>void print( int m,int n ){for( int i=1;i<=n-m;i++ )printf( " " );for( int i=1;i<=m*2-1;i++ )printf( "*" );puts("");if( m==n )return ;else{print( m+1,n );for( int i=1;i<=n-m;i++ )printf( " " );for( int i=1;i<=m*2-1;i++ )printf 阅读全文
posted @ 2011-11-16 00:52 狸の舞 阅读(460) 评论(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 狸の舞 阅读(112) 评论(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 狸の舞 阅读(198) 评论(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 狸の舞 阅读(147) 评论(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 狸の舞 阅读(210) 评论(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 狸の舞 阅读(275) 评论(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 狸の舞 阅读(594) 评论(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 狸の舞 阅读(160) 评论(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 狸の舞 阅读(467) 评论(0) 推荐(0) 编辑
摘要: DescriptionPetya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresp 阅读全文
posted @ 2011-11-16 00:44 狸の舞 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 下一页