首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
数组逆置
[编程题]数组逆置
热度指数:9060
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 64M,其他语言128M
算法知识视频讲解
输入一个字符串,长度小于等于200,然后将数组逆置输出。
输入描述:
测试数据有多组,每组输入一个字符串。
输出描述:
对于每组输入,请输出逆置后的结果。
示例1
输入
hdssg
输出
gssdh
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(4)
邀请回答
收藏(24)
分享
提交结果有问题?
66个回答
14篇题解
开通博客
用户抉择
发表于 2021-03-29 20:22:37
#include <stdio.h> #include <string.h> int main(){ char s[200]; while(
展开全文
牛客575349009号
发表于 2023-03-19 14:03:18
#include <stdio.h> #include <string.h> int main() { char s[200]; while(scanf("%s",&s)!=EOF){ int len=strlen(s); f
展开全文
小徐小徐啊啊
发表于 2024-03-10 21:24:09
#include <stdio.h> #include <string.h> int main() { char a[200]; while(scanf("%s",&a)!=EOF) { //char c=getchar(); f
展开全文
牛客7777779号
发表于 2023-02-23 11:22:05
用c++自带的reverse逆转函数 #include <algorithm> #include <iostream> using namespace std; int main() { string str; while (cin >> str)
展开全文
牛客7777779号
发表于 2023-02-23 11:29:52
不用c++ reverse函数的解法:(常规char数组方法)注意!尾指针指到字符数组最后一位是'\0',并不是有效字符, 此时,尾指针q需要回退一位。 #include <algorithm> #include <iostream> using namespace std
展开全文
MountainsHao
发表于 2024-03-15 17:25:41
#include <stdio.h> #include <string.h> int main() { char s[210]; while (scanf("%s", s) != EOF) { int len=strle
展开全文
也不容易的小白菜很怕黑
发表于 2023-03-24 22:48:57
#include<stdio.h> int main() { char string[100]; scanf("%s", string); int len = strlen(string); for (int i = 0; i < len / 2;
展开全文
牛客127952153号
发表于 2023-01-07 11:40:16
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string str; while (cin >>
展开全文
chong_0428
发表于 2024-03-03 22:26:24
while True: try: s = input() print(s[::-1]) except: break
KoukiAlpha
发表于 2023-01-24 15:37:56
#include <iostream> #include <algorithm> using namespace std; int main() { string str; while(cin >> str) { reverse(
展开全文
问题信息
数组
字符串
排序
难度:
66条回答
24收藏
7863浏览
热门推荐
通过挑战的用户
查看代码
大杯椰奶果茶
2023-03-04 20:06:51
能干的艾伦面试中
2023-03-01 08:53:23
_cherry
2023-02-28 10:17:06
Altina_...
2023-02-04 13:35:54
阿浩呀z
2022-11-09 18:32:02
相关试题
明明的随机数
数组
评论
(3704)
来自
华为研发工程师编程题
体育课测验(二)
广度优先搜索(BFS)
拓扑排序
dfs
评论
(2)
防火墙是怎么实现的?
计算机网络基础
评论
(1)
PMOS和NMOS的区别
元器件
评论
(1)
“乔布斯不做调查,张小龙不看数据。...
用户研究
评论
(1)
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
hdssg
gssdh