C016:字符串倒置

代码:

#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\n",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日--

posted @ 2020-06-10 10:53  逆火狂飙  阅读(310)  评论(0编辑  收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东