1、
#include <stdio.h> void rev_put(char x[]) { int i, len = 0; while(x[len]) len++; for(i = 0; i < len / 2; i++) { char tmp = x[i]; x[i] = x[len - 1 - i]; x[len - 1 - i] = tmp; } printf("result: %s ", x); } int main(void) { char str[129]; printf("str: "); scanf("%s", str); rev_put(str); return 0; }