代码:
#include "stdafx.h" #include <string.h> int _tmain(int argc, _TCHAR* argv[]) { char str[10]=""; do{ printf("Enter a number/string:"); scanf("%s",str); printf("%s ",strrev(str));// 颠倒字符串函数 strrev }while(strcmp(str,"999")!=0);// 字符串比较函数strcmp return 0; }
输出:
Enter a number/string:123 321 Enter a number/string:4577 7754 Enter a number/string:abc cba Enter a number/string:832987369821 128963789238
--2020年6月10日--