摘要:
单字符型数组1,2..9转换为整型数组1,2..9: 将他强制转换为整型后减48!例:#include <stdio.h>#include <stdlib.h>#include <string.h>int trans(char s[],int a[]){ int i=0,j,t=0; //char u[100]; while(s[i]!='\0') { if(s[i]==' '&&s[i+1]!='\0')i++; a[i]=int(s[i])-48; printf("%d " 阅读全文
摘要:
#include <stdio.h>#define MaxSize 100typedef int KeyType; /*关键字类型*/typedef char ElemType[10]; /*其他数据项类型*/typedef struct { KeyType key; /*关键字域*/ ElemType data; /*其他数据域*/} LineList; /*线性表元素类型*/void BubbleSort(LineList R[],int n){ int i,j,exchange; LineList tmp; for (i=0;i<n-1;i++) { exc... 阅读全文