上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页

2012年3月25日

经典排序之插入排序

摘要: 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 using namespace std; 5 6 int main() 7 { 8 int i,j,tem; 9 int length;10 int a[]={2,43,24,19,25,39,11,6,5};11 // length = a.length();12 length = sizeof(a)/sizeof(int);13 cout<<length<<endl;14 printf(" 阅读全文

posted @ 2012-03-25 12:37 NewPanderKing 阅读(209) 评论(0) 推荐(0) 编辑

经典排序之快排--数组模拟快排

摘要: 1 #include <stdio.h> 2 3 int partition(int *a,int low ,int high) 4 { 5 int privotpos; 6 int tem = a[low]; 7 privotpos = a[low]; 8 while(low<high) 9 {10 while(low<high && a[high]>=privotpos)high--;11 a[low] = a[high];12 while(low<high && a[low]<=privotpos... 阅读全文

posted @ 2012-03-25 12:33 NewPanderKing 阅读(723) 评论(0) 推荐(0) 编辑

经典排序之选择排序

摘要: #include <stdio.h>int main(){ int i,j,index,k; int tem,length; int a[10]={2,24,3,19,45,12,1,66,34,7};// length = a.length(); length = 10; printf("Before ordered:\n"); for(i = 0; i < length; i++) printf("%d ",*(a+i)); printf("\n\n"); for(i = 0; i < length; i+ 阅读全文

posted @ 2012-03-25 12:27 NewPanderKing 阅读(197) 评论(0) 推荐(0) 编辑

经典排序之冒泡排序代码

摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int i,j,k; 5 int tem,length; 6 int a[10]={2,24,3,19,45,12,1,66,34,7}; 7 // length = a.length(); 8 length = 10; 9 printf("Before ordered:\n");10 for(i = 0; i < length; i++)11 printf("%d ",*(a+i));12 printf("\n\n");13 for(. 阅读全文

posted @ 2012-03-25 12:25 NewPanderKing 阅读(422) 评论(0) 推荐(0) 编辑

关于cout计算顺序,从右到左计算顺序。

摘要: 1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 const int a[] = {10,20,30}; 7 const int *p = a; 8 cout<<"*p:"<<*p<<endl; 9 cout<<"*p:"<<*p<<"\t*p++:"<<*p++<<"\t*p"<<*p<<endl; 1 阅读全文

posted @ 2012-03-25 12:15 NewPanderKing 阅读(1875) 评论(0) 推荐(0) 编辑

2012年3月23日

交换两个数字,不借助于第三个变量的三种简单的方法。

摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int a = 10,b=20; 5 // solution 1: a = a+b; b = a-b; a = a-b; 6 printf("*********************************************\n"); 7 printf("Change two number without another number!!!!\n"); 8 printf("************************************* 阅读全文

posted @ 2012-03-23 16:18 NewPanderKing 阅读(1617) 评论(1) 推荐(0) 编辑

2011年12月5日

Problem E: Communication

摘要: Problem E: CommunicationTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 66 Solved: 11[Submit][Status][Web Board]DescriptionMilitary training has started... 阅读全文

posted @ 2011-12-05 21:34 NewPanderKing 阅读(397) 评论(0) 推荐(0) 编辑

2011年10月3日

poj 1011 sticks

摘要: SticksTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 88760Accepted: 19784DescriptionGeorge took sticks of the same length and cut them rand... 阅读全文

posted @ 2011-10-03 20:12 NewPanderKing 阅读(3348) 评论(0) 推荐(3) 编辑

2011年9月23日

hdu 2531 Catch him

摘要: Catch himTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 124Accepted Submission(s): 49Problem Description在美式足球中,四分卫负责指挥整只球队的进攻战术和跑位,以及给接球员传球的任务。四分卫是一只球队进攻组最重要的球员,而且一般身体都相对比较弱小,所以通常球队会安排5-7名大汉来保护他,其中站在四分卫前方、排成一线的5名球员称为进攻锋线,他们通常都是135公斤左右的壮汉。对防守方来说,攻击 阅读全文

posted @ 2011-09-23 20:52 NewPanderKing 阅读(396) 评论(0) 推荐(0) 编辑

2011年9月22日

zoj poj 题目分类

摘要: ZOJ题目分类初学者题:1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 1334 1337 1338 1350 1365 1382 1383 1394 1402 1405 1414 1494 1514 1622 1715 1730 1755 1760 1763 1796 1813 1879 1889 1904 1915 1949 2001 2022 2099 2104 2108 2172 2176 2201 2208 2321 2345 2351 2376 2388 240 阅读全文

posted @ 2011-09-22 20:36 NewPanderKing 阅读(830) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页

导航