-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dengshaolin
committed
Mar 10, 2011
0 parents
commit 6cdf4ef
Showing
1,288 changed files
with
194,514 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
const int b=10; | ||
const int * const a=&b; | ||
int const * const c=&b; | ||
printf("a:%d\n",*a); | ||
printf("c:%d\n",*c); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int i,j; | ||
printf("\1\1\n"); | ||
for(i=1;i<11;i++) | ||
{ | ||
for(j=1;j<=i;j++) | ||
{ | ||
printf("%c%c",219,219); | ||
printf("\n"); | ||
} | ||
} | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <stdio.h> | ||
#include "test1.c" | ||
int main(){ | ||
char * sr="hello,world!"; | ||
test1(sr); | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int i,j,result; | ||
printf("\n"); | ||
for(i=1;i<10;i++) | ||
{ | ||
for(j=1;j<=i;j++) | ||
{ | ||
result=i*j; | ||
printf("%d*%d=%-3d",j,i,result); | ||
} | ||
printf("\n"); | ||
} | ||
return 1; | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
void shell_sort(int a[],int len) | ||
{ | ||
int h,i,j,temp; | ||
|
||
for(h=len/2;h>0;h=h/2)//控制增量 | ||
{ | ||
for(i=h;i<len;i++)//这个循环 直接插入排序 | ||
{ | ||
temp=a[i]; | ||
for(j=i-h;(j>=0&&temp<a[j]);j-=h) | ||
{ | ||
a[j+h]=a[j]; | ||
} | ||
a[j+h]=temp; | ||
} | ||
} | ||
} | ||
void print_array(int a[],int len) | ||
{ | ||
for(int i=0;i<len;i++) | ||
{ | ||
cout<<a[i]<<""; | ||
} | ||
cout<<endl; | ||
} | ||
int main() | ||
{ | ||
int a[]={7,3,5,8,9,1,2,4,6}; | ||
cout<<"before shell sort"; | ||
print_array(a,9); | ||
shell_sort(a,9); | ||
cout<<"after shell sort"; | ||
print_array(a,9); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <math.h> | ||
bool mysushu(int m){ | ||
int temp=sqrt(m); | ||
for (int i=2;i<=temp;i++) | ||
{ | ||
if(! m%temp) | ||
{ | ||
return true; | ||
} | ||
else | ||
break; | ||
} | ||
return false; | ||
} | ||
|
||
int main() | ||
{ | ||
int n=1,m=2;int count=0; | ||
int i=1; | ||
printf("please input a range:a,b\n"); | ||
scanf("%d,%d",&m,&n); | ||
for(i=m;i<=n;i++) | ||
{ | ||
if (mysushu(i)) | ||
{ | ||
printf("%d is a sushu\n",i); | ||
count++; | ||
} | ||
else | ||
break; | ||
} | ||
printf("%d-%d have %d suhu",m,n,count); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <stdio.h> | ||
void test1(char * s) | ||
{ | ||
printf("this is a test %s",s); | ||
} | ||
/*stuct test_struct{ | ||
int i; | ||
int j; | ||
char * name; | ||
}test1;*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
int test(char *src) | ||
{ | ||
char dest[1024]={0}; | ||
strcpy(dest,src,strlen(src)-1); | ||
return 1; | ||
} | ||
|
||
int main() | ||
{ | ||
char * a="hello"; | ||
int b=test(a); | ||
printf("%d",b); | ||
pause(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
D/primer//// | ||
D/up_c++//// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/quicksort.cpp/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++/primer/Alog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include <iostream> | ||
using namespace std; | ||
void QuickSort(int *pData,int left,int right) | ||
{ | ||
int i(left),j(right),middle(0),iTemp(0); | ||
middle=pData[(left+right)/2];//求中间值 | ||
middle=pData[(rand()%(right-left+1))+left]; //生成大于等于left小于等于right的随机数 | ||
do{ | ||
while((pData[i]<middle)&&(i<right))//从左扫描大于中值的数 | ||
i++; | ||
while((pData[j]>middle) && (j>left))//从右扫描小于中值的数 | ||
j--; | ||
//找到了一对值,交换 | ||
if(i<=j){ | ||
iTemp=pData[j]; | ||
pData[j]=pData[i]; | ||
pData[i]=iTemp; | ||
i++; | ||
j--; | ||
} | ||
}while(i<=j);//如果两边扫描的下标交错,就停止(完成一次) | ||
//当左边部分有值(left<j),递归左半边 | ||
if(left<j){ | ||
QuickSort(pData,left,j); | ||
} | ||
//当右边部分有值(right>i),递归右半边 | ||
if(right>i){ | ||
QuickSort(pData,i,right); | ||
} | ||
} | ||
int main() | ||
{ | ||
int data[]={10,9,8,7,6,5,4}; | ||
const int count(6); | ||
QuickSort(data,0,count); | ||
for(int i(0);i!=7;++i) | ||
{ | ||
cout<<data[i]<<""<<flush; | ||
} | ||
cout<<endl; | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
D/Alog//// | ||
D/cp1//// | ||
D/cp2//// | ||
D/cp3//// | ||
D/cp4//// | ||
D/inteview//// | ||
D/strop//// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++/primer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
D/ex1//// | ||
D/ex2//// | ||
D/ex_tmp//// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++/primer/cp1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/AUTHORS/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/ChangeLog/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/Makefile.am/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/NEWS/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/README/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/autoscan.log/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/configure/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/configure.in/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
D/autom4te.cache//// | ||
/main.c/1.2/Tue Jan 11 08:40:50 2011// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++/primer/cp1/ex1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/output.0/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/requests/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
/traces.0/1.1.1.1/Tue Jan 11 07:48:14 2011// | ||
D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
C++/primer/cp1/ex1/autom4te.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/dengshaolin/repository_cvs/ |
Oops, something went wrong.