11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 1...... #include #include #define N 10void yanghui(int a[][N],int n);void main(){ int i,j,n,b[N][N]; printf("Enter n:"); scanf("%d",&n... Read More
posted @ 2007-04-26 15:27 齐心 Views(658) Comments(0) Diggs(0) Edit
#include#include#includevoid main(){ int i,flag; int compstr(char,char); char str1[80],str2[80]; clrscr(); gets(str1); gets(str2); i=0; do{ flag=compstr(str1[i],str2[i]); i++; }while(st... Read More
posted @ 2007-04-26 11:19 齐心 Views(6073) Comments(2) Diggs(0) Edit
1、字符串的输出方法char str[20]="How are you?";printf("%s,%c",str,str[2]);int put(char *str)puts(str)printf和puts的区别:puts()输出一行时,它会自动将字符串结尾的'\0'转换成换行符,因此不必另加换行符'\n'printf()输出一行时,它不会自动换行。2、字符串的输入方法char s[14];sca... Read More
posted @ 2007-04-26 10:19 齐心 Views(4760) Comments(0) Diggs(0) Edit
折半查找法:只能针对有序数组进行查找。可以将数组利用选择或冒泡排序后再进行查找。 #include#include#define N 10void xuanzhe(int a[],int n);void maopao(int a[],int n);void find(int a[],int n);void main(){ int a[N],i; clrscr(); for(i=0;ia[j+... Read More
posted @ 2007-04-26 09:53 齐心 Views(2615) Comments(0) Diggs(0) Edit
#include#include#define N 5void xuanze(int a[],int n);void maopao(int a[],int n);void main(){ int a[N],i; clrscr(); for(i=0;ia[j+1]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; flag=1; } if(flag==0) b... Read More
posted @ 2007-04-26 09:40 齐心 Views(355) Comments(1) Diggs(0) Edit