题解 1093: 字符逆序

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

字符逆序---还可以

解题思路:遍历列表中的每一个元素,从列表的最后开始遍历,列表a[::-1]表示从最后一个元素开始,将每一个元素都倒序赋值给一个新的变量,添加道一个新的列表里,输出列表,元素倒序不一定要用reverse函数。注意事项:参考代码:a=input()b=a.split()foriinb[::-1]:c=i[

字符逆序(c语言极简)

摘要:解题思路:一口气读入后跳过末尾&#39;\0&#39;后直接输出,清晰明了,简单粗暴注意事项:注意跳过&#39;\0&#39;即可参考代码:#include<stdio.h>#include<stri……

1093: 字符逆序

```cpp#includeusingnamespacestd;intmain(){charstr[100];gets(str);//用gets输入的字符串可以按回车结束intk=strlen(str);for(intw=k-1;w>=0;w--){cout

1093: 字符逆序

摘要:解题思路:注意事项:参考代码:public class test1093 {    public static void main(String[] args) {//        将一个字符串st……

c语言利用指针解决(代码简洁)

```c#includeintmain(){charstr[100];char*p=str,*q=str;//定义两个指针变量,并指向数组首地址gets(str);while(*q!='\0')//当q未指向结束符时,q++,将q指向下一个元素{q++;}while(p!=q){q--;//q从最后位

1093: 字符逆序(C语言版)

**具体代码:**```c#include#includeintmain(){charstr[100];gets(str);for(inti=strlen(str)-1;i>=0;i--)printf("%c",str[i]);return0;}```

用切片来写

摘要:a=input()count=len(a)z=count-1q=countfor i in range(count):    print(a[z:q],end=&#39;&#39;)    z-=1 ……

1093: 字符逆序(c++)

摘要:解题思路:注意事项:主义头文件#include<string>参考代码:#include <iostream>#include<string>using namespace std;int main(……