摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2493 判断输入坐标在哪个方位,建立坐标系,关键是与 坐标原点比较#include<stdio.h>int main(){ int h,z,t,a,b; while(scanf("%d",&t)!=EOF){ if(t==0)break; scanf("%d%d",&a,&b); while(t--){ s 阅读全文
posted @ 2013-02-28 18:53 L kill 阅读(119) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2113 判断两个数的大小,输出>或<或=#include<stdio.h>int main(){ int t; long a,b; scanf("%d",&t); while(t--){ scanf("%ld%ld",&a,&b); if(a>b)printf(">\n&q 阅读全文
posted @ 2013-02-28 18:52 L kill 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2899 t表示次数,换行表示一次,#include<stdio.h>int main(){ char b; int m=0,a[10000],i,t,max; scanf("%d",&t); while(t--){ m++; scanf("%d",&a[0]); max=a[0]; for(i=1;(b=getch 阅读全文
posted @ 2013-02-28 18:51 L kill 阅读(104) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2827 三个数中,选出中间那个,cmax我用来表示的#include<stdio.h>int main(){ int n,a,b,c,cmax,m=0; scanf("%d",&n); while(n--){ m++; scanf("%d%d%d",&a,&b,&c); if(a>b)if(a 阅读全文
posted @ 2013-02-28 18:50 L kill 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2864 玛丽奥跳高跳低的,输出跳高跟跳低的次数 定义两个变量统计。#include<stdio.h>int main(){ int n,t,h,l,a[50],i,m=0; scanf("%d",&n); while(n--){ h=l=0; scanf("%d",&t); scanf("%d" 阅读全文
posted @ 2013-02-28 18:48 L kill 阅读(97) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2307f(n) = 1+2+3+4+5+6+7+8+9+2 = 47 f(f(n)) = 4+7 = 11 f(f(f(n))) = 1+1 = 2一直重复做,直到是单位数#include<stdio.h>int main(){ long n,t,sum=0; while(scanf("%ld",&n)!=EOF){ if(n==0)brea 阅读全文
posted @ 2013-02-28 18:47 L kill 阅读(159) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1985不知道在讲什么,只是瞎蒙的,居然对了,求指教 啊#include <stdio.h> int main(){ int a,b,t; scanf("%d",&t); while(t--) { scanf("%d%d",&a,&b); printf("%d\n",(a/3)*(b/3) 阅读全文
posted @ 2013-02-28 18:45 L kill 阅读(93) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1753 給你這2個值,你能推出這2隊最後的得分是多少嗎? Input輸入的第一列有一個整數,代表以下有多少組測試資料。每組測試資料一列,有2個大於等於 0 的整數 s, d,s 代表比賽結束時2隊分數的總和, d 代表比賽結束時2隊分數差的絕對值。Output對每組測試資料輸出一列,包含2個整數代表比賽結束時這2隊的分數,分數大的在前。如果沒有這樣的分數,請輸出「 impossib 阅读全文
posted @ 2013-02-28 18:44 L kill 阅读(188) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1241 他输入的第一行包含一个正整数n(<20),测试用例的数量。每个测试案例开始行包含一个整数F(0<F<20),农民在测试用例的数量。这条线后面一个农民每行包含三个正整数,每个农家平方米大小的,动物的数量,他拥有和农民的环境友好的整数值表示。终止输入文件的末尾。在输入中没有整数大于100000或小于0。 ? 产量 对于每个测试用例输出一行,包含一个整数,持有的 阅读全文
posted @ 2013-02-28 18:43 L kill 阅读(188) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=435 判断句子中有几个词; 句子中除了字母,标点,空格都是判断标志, 有时候会出现很多的标点,所以要设置一个变量来判断,如n#include<stdio.h>#include<string.h>int main(){ char s[1000]; int i,num,t,n; while(gets(s)!=NULL){ num=0; n=0; t=strlen 阅读全文
posted @ 2013-02-28 18:41 L kill 阅读(121) 评论(0) 推荐(0) 编辑