#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXSIZE 100
void reverse(){
//反序输出字符串
char s[MAXSIZE];
char st[MAXSIZE];
int top=-1;
scanf("%s",s);
int n=strlen(s);
for(int i=0;i<n;i++){
st[++top]=s[i];
}
while(top>-1){
printf("%c",st[top--]);
}
}
int main()
{
reverse();
}
c语言---字符串的反向输出
最新推荐文章于 2023-12-20 20:49:19 发布