摘要: 阅读全文
posted @ 2013-01-07 20:58 孤独是一种力量 阅读(446) 评论(0) 推荐(0) 编辑
摘要: #include <stdlib.h>#include <stdio.h>#include <time.h>#define MAX 100 //MAX为最大值,其随机域为0~MAX-1int main( ){ srand((unsigned)time( NULL )); for(int i=0;i<3;i++)//随机输出次数 printf("%d\n",rand()%MAX); return 0;}虽然人品确实不行 不过为了那刷屏的wrong answer 纪念一下 阅读全文
posted @ 2013-01-07 20:21 孤独是一种力量 阅读(150) 评论(0) 推荐(0) 编辑
摘要: int heapsort(int heap[],int sizeheap)//堆排序部分 本题未应用{ int i,t; for(i=sizeheap;i>=2;i--) { t=heap[sizeheap]; heap[sizeheap]=heap[1]; heap[1]=t; sizeheap=sizeheap-1; maxheap (heap, sizeheap, 1); }}公主之魔镜魔镜Time Limit: 1000 MSMemory Limit: 32768 KTotal Submit:... 阅读全文
posted @ 2012-12-09 18:57 孤独是一种力量 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Series DeterminationTime Limit: 1000 MSMemory Limit: 65536 KDescriptionBoudreaux and Thibodeaux aren't very good at math, so they need you to write a program that can determine the second degree polynomial used to generate a given sequence of three integers. As proof that you've figured out 阅读全文
posted @ 2012-12-07 18:49 孤独是一种力量 阅读(221) 评论(0) 推荐(0) 编辑
摘要: # include <stdio.h># include <string.h>int main(){ char s1[1000], s2[1000]; int i, j, k1,k2 ; while ( scanf("%s%s", s1, s2) != EOF) { getchar(); k1=strlen(s1); k2=strlen(s2); printf("%d %d\n",k1,k2); if(strcmp(s1,s2)==0)printf("SAME\n"); else pri... 阅读全文
posted @ 2012-11-17 23:51 孤独是一种力量 阅读(111) 评论(0) 推荐(0) 编辑