上一页 1 ··· 23 24 25 26 27
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=418这题跟476差别不多,只多一个存储圆形,计算点到圆心的距离并和半径比较,判断是否在圆内#include<stdio.h>//思路跟476基本一样,而且本题代码可以解476,不同之处在于本题要多一个结构体储存circle#include<string.h>#include<stdlib.h>#include< 阅读全文
posted @ 2013-02-18 15:24 执着追求的IT小小鸟 阅读(303) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=417这题是给出某几个矩形的长和宽的坐标,然后输入点判断点是否在那些矩形里面,其中的x,y有些没按顺序输入 要自己调整View Code 1 #include<stdio.h>//本题关键在于输入给的数据只按xy的顺序,两个xy没按顺序 2 #include<string.h> 3 struct rec{ 4 double x1 阅读全文
posted @ 2013-02-18 14:55 执着追求的IT小小鸟 阅读(236) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=399这题不太理解,只单纯把上面字母对应的ascii码减去下面的,得到差值,然后,依次得到结果View Code 1 #include<stdio.h> 2 void zhuanhua(char *s) 3 { 4 while(*s) 5 { 6 (*s)=(*s)-7; 7 s++; 8 } 9 }10 int main()11 {12 阅读全文
posted @ 2013-02-18 14:51 执着追求的IT小小鸟 阅读(55) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=286本题类似于做一个随机数产生器,利用l=(z*l+i)%m产生出l,然后保留l,直到l再次出现,循环中要特别注意But be careful:the cycle might not begin with the seed!,就是第一个l不保存View Code 1 #include<stdio.h> 2 int j,len; 3 lon 阅读全文
posted @ 2013-02-18 14:46 执着追求的IT小小鸟 阅读(107) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=386按题目给出的字母和符号作出迷宫,遇到\0和!就换行,遇到将字母前的数字叠加为n,然后输出n个数字后面的那个字母,其中b代表空格View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int i,j,sum; 6 char str[10000 阅读全文
posted @ 2013-02-18 14:13 执着追求的IT小小鸟 阅读(126) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=365本题类似于udoj上的A+B2,是大数相加的问题,用高精度,把数字用字符串接收,然后放入数组依次想加再输出View Code 1 #include<stdio.h>//本题类似于A+BⅡ 2 #include<stdlib.h> 3 #include<string.h> 4 void zhuanhua(char 阅读全文
posted @ 2013-02-18 11:19 执着追求的IT小小鸟 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=235这题中车厢的调动次数正好和排序的交换次数一致,所以只要进行排序并记录就可以了View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 int n,L,l[100],i,cs,j,temp; 6 scanf("%d",&am 阅读全文
posted @ 2013-02-18 11:15 执着追求的IT小小鸟 阅读(89) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=208需要设置一个静态的变量以保证每次遇到引号都能正确做出判断,这里设置一个flag为正负1,每次遇到引号就变一次符号View Code 1 #include<stdio.h> 2 int main() 3 { 4 int i,flag=1;//标记变量,左引号为-1,右引号为1 5 char str[100000]; 6 while(ge 阅读全文
posted @ 2013-02-18 11:12 执着追求的IT小小鸟 阅读(150) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=49关键在于double所表示的范围是-2^1024~2^1023 float表示范围是-2^128~2^127,用double足以解决问题,还有就是用数学公式表达出根号#include<stdio.h>#include<math.h>int main(){ int n; double p; while(scanf(" 阅读全文
posted @ 2013-02-18 11:06 执着追求的IT小小鸟 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 本题从小到大依次算出每个数的所需步骤,然后保留最大的步骤数,这是暴力代码,打表正在学习中……http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=36View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 int i,b,a,temp,n,m,j; 6 while(scanf("%d%d& 阅读全文
posted @ 2013-02-18 11:04 执着追求的IT小小鸟 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27