¶«±±´óѧÈí¼þ¼¼Êõ»ù´¡ÊµÑ鱨¸æ ÏÂÔر¾ÎÄ

ʵÑéÒ»

´úÂ룺

#include \#include // ¶¨ÒåÒ»¸öÏßÐÔ±í

const int nMaxSize = 15; // ×î´óÖµ int nLen = 0; // ±íÖÐÔªËظöÊý int nLinearList[nMaxSize];

// ¶¨Òå²Ù×÷ void LSort(); void LOut();

void LInsert(int n); void LDelete(int n); void main() {

// ÊäÈëÊý¾Ý²¢·ÅÈëÏßÐÔ±íÖÐ

printf(\// std::cout << \ int nIn = 0;

for (int i = 0; i <= 9; i++) { scanf(\// std::cin >> nIn; nLinearList[i] = nIn; nLen++; }

LSort(); // ÅÅÐòÏßÐÔ±í LOut(); // Êä³ö½á¹û

printf(\ scanf(\

LInsert(nIn); // ÊäÈëÒ»¸öÊý×Ö£¬²¢²åÈëµ½ÏßÐÔ±íÖÐ LOut(); LSort();

printf(\ LOut(); while(1) {

printf(\ scanf(\

if (nIn>nLen)

printf(\

else break; }

LDelete(nIn); // ÊäÈëÒ»¸öÊý×Ö£¬²¢´ÓÏßÐÔ±íÖÐɾ³ý LOut();

char chTmp;

printf(\ chTmp = getch(); }

void LSort() // ðÅÝÅÅÐò,ÓÉ´óµ½Ð¡ {

int i,j,temp;

for (j=0;j

for (i=0;i

if (nLinearList[i]

void LOut() {

printf( \

for (int i = 0; i <= nLen; i++) { printf( \ }

printf( \}

void LInsert(int k) { int i,j;

while(1) {

printf(\£º\ scanf(\

if (j>nLen)

printf(\ else break; }

for(i = nLen; i >= j ; --i) nLinearList[i] =nLinearList[i - 1]; nLinearList[j-1] = k; nLen++; }

void LDelete(int m) { int i;

for(i = m; i <= nLen; ++i) nLinearList[i-1] = nLinearList[i]; nLen--; }

ʵÑé¶þ

´úÂ룺

#include