标签:include color clu 反转字符串 print i++ pre 反转 字符
#include<stdio.h> void fun(char *str,int len){ for(int i=0;i<len/2;i++){ char temp = str[i];str[i] = str[len-1-i]; str[len-1-i] = temp; } for(int i=0;i<len;i++){ printf("%c",str[i]); } } int main(){ char s[] = {‘a‘,‘b‘,‘c‘,‘d‘,‘e‘}; fun(s,5); return 0; }
标签:include color clu 反转字符串 print i++ pre 反转 字符
原文地址:https://www.cnblogs.com/xuecl/p/13052980.html