- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 Moving Tables
唉,因为对P的定义没搞清楚,导致一直wa....以为在后面有一个将面对面的房间号变换统一,P可能会到达201,只定义200个是不够的。。。。还好找出来了,一个半小时啊,差点儿就要放弃了。。这题我的思路就是将每个房间都进行标记,每次路过那个房间都记一次数,这样最后计数最大的那个房间所记的数就可以标记我们所用时间的长短了。在这次AC中,我最大的收获是学会使用了两个函数。
2013-12-12 15:20:55 695
原创 Fibonacci数列的计算和转换
#include#define N 30int i=0;int a[N];int fun(int first, int second, int num){ int temp; a[i] = first; a[i+1] = second; while(num --) { ++i; a[i+1] = a[i-1] +
2013-12-08 21:27:01 568
原创 字符串反向输出
#include#include#define N 100int main(){ char a[N], b[N]; int len, i = 0; scanf("%s", a); len = strlen(a); b[len] = '\0'; while(len--) { b[i] = a[len];
2013-12-08 21:24:16 497
原创 Vowel Counting
搞清楚元音字母有:a e i o u 即可。#include#includeint main(){ char a[50]; int N; int len, i; while(scanf("%d", &N)!=EOF) { while(N--) { scanf("%s", a);
2013-12-07 13:53:58 441
原创 Identity Card
感觉直接字符匹配就可以了。#include#includechar area(char a, char b){ char c; switch(a) { case '3': if(b == '3') c = 'Z'; if(b == '1') c = 'S'; br
2013-12-07 13:36:00 8717
原创 decimal system
这一题的重点有2个, 一个是将字符转化为int, 其次是将数字串计算为十进制数。下面是实现的代码。#include#include#define N 1000int main(){ char a[N]; //存储输入的字符串 int n[N]; int m, i, j, b, form; long sum; while(scanf("
2013-12-07 12:52:40 429
原创 Higher Math
求个最大边,然后根据直角三角形两边平方和等于第三边的平方,即可确定这是个直角三角形。#includeint main(){ int a,b,c,temp,N; int i=1; while(scanf("%d", &N)!=EOF) { while(N--) { scanf("%d %d %d"
2013-12-06 20:53:33 441
原创 The Seven Percent Solution
想复杂了。。。 #include #include #define M 80 int main() { char a[M]; int i; while(gets(a)) { if(a[0] == '#') break; for(i=0;(
2013-12-06 16:51:54 718
原创 Rightmost Digit
#includeint fun(a){ int c, n; c = a%10; switch(c) { case 0: case 1: case 5: case 6: case 9: n = c; break; case
2013-12-05 11:36:26 459
原创 An Easy Task
#includeint main(){ int Y, N, M; scanf("%d", &M); while(M--) { scanf("%d %d", &Y, &N); if(N10000) break; if(!((Y%4 == 0)&&(Y%100 != 0) || (Y%400 == 0)))
2013-12-04 17:01:14 411
原创 Box of Bricks
#includeint main(){ int M, num, m, j=1; int a[51]; int i, avg; while((scanf("%d", &M)!= EOF) && M) { num = 0; m = 0; for(i=0; i<M; i++){ scanf("%d", &a[i]); m += a[i]; } avg = m/M; for(i=0; i avg) num
2013-12-04 15:07:26 401
原创 诗后杂谈
阅尽天涯离别苦,不道归来,零落花如许。花底相看无一语,绿窗春与天俱莫。 待把相思灯下诉,一缕新欢,旧恨千千缕。最是人间留不住,朱颜辞镜花辞树。— —《蝶恋花》王国维 人间悲苦 离别苦 相逢亦苦 光阴荡去容颜 一分重逢难敌十分久别 行至天涯 看尽万般风情 重归故地 故人已飘零如落花随水
2013-07-15 23:47:07 356
原创 poj.org pro 1003 hangover
/*poj.org pro 1003author: bubbledate: 2013-7-15*/#includeint main(){double sum;int n;double len;while(scanf("%lf",&sum)!=EOF&&sum!=0.00){ n=1; len=0.00; do{
2013-07-15 19:38:20 429
原创 poj.org Pro 1004
/* poj.org problem 1004 finacial managementauthor: bubbledate: 2013-7-15*/#includeint main(){ float a[12],m=0.0,n=0.0; int i; for(i=0;i scanf("%f",&a[i]); n=
2013-07-15 11:04:07 447
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人