上一页 1 ··· 11 12 13 14 15
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=2012 素数判定Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x<y<=50),判定该表达式的值是否都为素数。Input输入数据有多组,每组占一行,由两个整数x,y组成,当x=0,y=0时,表示输入结束,该行不做处理。Output对于每个给定范围内的取值,如果表达式的值都为素数,则输出"OK",否则请输出“Sorry”,每组输出占一行。Sample Input0 10 0Sample Ou 阅读全文
posted @ 2011-04-11 21:26 淡墨æ末央 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 原型:extern char *strchr(char *s,char c); 用法:#include <string.h> 功能:查找字符串s中首次出现字符c的位置 说明:返回首次出现c的位置的指针,如果s中不存在c则返回NULL。 举例:#include<string.h>#include<stdio.h>int main(){ char *str="Hello,I am jian1573,I liking programing!"; char character='m' ; //指定一个字符 char *strtem 阅读全文
posted @ 2011-04-02 11:08 淡墨æ末央 阅读(425) 评论(2) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1001Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, o 阅读全文
posted @ 2011-04-01 19:50 淡墨æ末央 阅读(759) 评论(2) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1000超级水的题:View Code 1 #include<stdio.h>2 #define P 3.14159273 main()4 {5 int a,b;6 while(scanf("%d%d",&a,&b)==2)7 printf("%d\n",a+b);8 return 0;9 } 阅读全文
posted @ 2011-04-01 19:42 淡墨æ末央 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 快速排序qsort真的很强大一、对int类型数组排序int num[100];int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100];int cmp( const void *a , const void *b ){return *(char *)a - *(int *)b;}qsort(word,100,sizeof(word[0]),cmp);三、对double类. 阅读全文
posted @ 2011-04-01 15:27 淡墨æ末央 阅读(836) 评论(4) 推荐(0) 编辑
摘要: 链接 :http://acm.hdu.edu.cn/showproblem.php?pid=1008本题为一道简单的数学题没什么难的 ;但还是要注意Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to 阅读全文
posted @ 2011-03-29 22:08 淡墨æ末央 阅读(281) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15