2012年3月8日
该文被密码保护。 阅读全文
posted @ 2012-03-08 21:29 C's 阅读(1) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2012-03-08 21:19 C's 阅读(0) 评论(0) 推荐(0)
  2012年3月2日
摘要: #include<stdio.h>#include<malloc.h>#include"2.cpp"#define MaxSize 50typedef char ElemType;extern void InitList(SqList *&L);extern void DestroyList(SqList *&L);extern int ListEmpty(SqList *L);extern int ListLength(SqList *L);extern void DispList(SqList *L);extern int Get 阅读全文
posted @ 2012-03-02 11:26 C's 阅读(287) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<malloc.h>#define MaxSize 50typedef char ElemType;typedef struct{ElemType data[MaxSize];int length;}SqList;void InitList(SqList * &L) //初始化顺序表L{L=(SqList *)malloc(sizeof(SqList));L->length=0;}void DestroyList(SqList *&L) //释放顺序表L{free(L);}int ListEmpty 阅读全文
posted @ 2012-03-02 11:26 C's 阅读(206) 评论(0) 推荐(0)
  2012年2月29日
摘要: 8.6写一函数,将两个字符串连接。 lianjie(char *a,b); {strcat(a,b); } main() {char str1[100],str2[100]; gets(str1);gets(str2); lianjie(str1,str2) puts(str1); }8.7写一函数,将两个字符串中的元音字母复制到另一个字符串,然后输出。 fuzhi(a[],b) {int i,j=0; for(i=0;a[i]!=’\0’;i++) if(a[i]==97||a[i]==101||a[i]==105||a[i]==111||a[i]==117||a[i]==65|| a[i] 阅读全文
posted @ 2012-02-29 21:38 C's 阅读(486) 评论(0) 推荐(0)
摘要: View Code #include<stdio.h>void zhuanzhi(int b[3][3]) { int i,j,t; for(i=0;i<3;i++) for(j=0;i>=j&&i<3;j++) { t=b[i][j]; b[i][j]=b[j][i]; b[j][i]=t; } } void main() { int a[3][3];int i,j; for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%d",&a[i... 阅读全文
posted @ 2012-02-29 21:04 C's 阅读(16908) 评论(0) 推荐(0)
摘要: View Code #include<stdio.h>#include<math.h>int psushu(int m) { int i=2,t=0; for(;i<=m;i++) { if(m%i==0&&i<m) break; if(m-i==0) t=1; }return t; } void main() { int a,s; printf("enter shu is \n"); scanf("%d",&a); s=psushu(a); if(s==1) printf... 阅读全文
posted @ 2012-02-29 20:16 C's 阅读(10798) 评论(0) 推荐(0)
摘要: View Code #include<stdio.h>#include<math.h>void yishigen(float m,float n,float k) { float x1,x2; x1=(-n+(float)sqrt(k))/(2*m); x2=(n-(float)sqrt(k))/(2*m); if(x1==x2) printf("=%.3f\n",x1); else printf("two shigen is x1=%.3f and x2=%.3f\n",x1,x2); } void denggen(floa.. 阅读全文
posted @ 2012-02-29 20:05 C's 阅读(5474) 评论(0) 推荐(0)
摘要: 一、改正下列程序中的编译错误1.写两个函数,分别求两个整数的最大公约数和最小公倍数,用主函数调用这两个函数,并输出结果两个整数由键盘输入。 maxyueshu(m,n); { int i=1,t; for(;i<=m&&i<=n;i++) {if(m%i!=0&&n%i=0) t} return(t); } minbeishu(m,n) {int j; if(m>=n) j=m; else n; for(;!(j%m=!0&&j%n=!0);j++); return j; } main() {int a,b,max,min; p 阅读全文
posted @ 2012-02-29 19:22 C's 阅读(749) 评论(0) 推荐(0)
摘要: View Code #include<stdio.h>void main(){ int a[10]={1,7,8,18,23,24,59,62,99,0},i,j=10,k; for(i=0;i<j;i++) { if(a[i]%3==0) { for(k=i;k<j;k++) a[k]=a[k+1]; j--; } } printf("{"); for(i=0;i<j;i++) printf("%5d",a[i]); printf("}");} 阅读全文
posted @ 2012-02-29 18:42 C's 阅读(408) 评论(0) 推荐(0)