程序代码:
/******************************************************** ** Highlight software by yzfy(雨中飞燕) http:// * *********************************************************/008000]/******************************************************** ** Highlight software by yzfy(雨中飞燕) http:// * *********************************************************/ /******************************************************** ** Highlight software by yzfy(雨中飞燕) http:// * *********************************************************/ [/color]FF0000]#include [/color]<stdio.h> FF0000]#include [/color]<stdlib.h> FF0000]#include [/color]<FF0000]string[/color].h> FF0000]#define [/color]800080]N 81 [/color]0000FF]int [/color]FF0000]main[/color]() { 0000FF]void [/color]008080]Reserve[/color](0000FF]int[/color],0000FF]char[/color]*); 0000FF]char [/color]a[800080]N[/color]]; 0000FF]int [/color]m; FF0000]printf[/color](FF00FF]"please input a string:\n"[/color]); FF0000]gets[/color](a); FF0000]printf[/color](FF00FF]"please input m=:"[/color]); FF0000]scanf[/color](FF00FF]"%d"[/color],&m); 008080]Reserve[/color](m,a); FF0000]puts[/color](a); 008080]system[/color](FF00FF]"PAUSE"[/color]); 0000FF]return [/color]800080]0[/color]; } 0000FF]void [/color]008080]Reserve[/color](0000FF]int [/color]index,0000FF]char [/color]*a) { 0000FF]int [/color]i,j; 0000FF]char [/color]t; i=index; j=D04000]strlen[/color](a)-800080]1[/color]; 0000FF]while[/color](i<j) { t=a[i]; a[i]=a[j]; a[j]=t; i++; j--; } }
[[it] 本帖最后由 布拉莫斯 于 2008-5-5 23:12 编辑 [/it]]
真理往往掌握在少数人手中,可现实却是少数服从多数!