首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
数组逆置
[编程题]数组逆置
热度指数:10211
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 64M,其他语言128M
算法知识视频讲解
输入一个字符串,长度小于等于200,然后将数组逆置输出。
输入描述:
测试数据有多组,每组输入一个字符串。
输出描述:
对于每组输入,请输出逆置后的结果。
示例1
输入
hdssg
输出
gssdh
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(4)
邀请回答
收藏(28)
分享
提交结果有问题?
72个回答
16篇题解
开通博客
用户抉择
发表于 2021-03-29 20:22:37
#include <stdio.h> #include <string.h> int main(){ char s[200]; while(
展开全文
牛客440904392号
发表于 2024-10-01 01:24:57
//C++版代码 #include <iostream> #include <algorithm> using namespace std; int main() { string s; cin >> s; reverse(s.begin(
展开全文
牛客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 >>
展开全文
西格玛的浪漫
发表于 2025-03-07 01:58:24
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> int main() { char str[201]; char str1[201]; scanf(&quo
展开全文
问题信息
数组
字符串
排序
难度:
72条回答
28收藏
11047浏览
热门推荐
通过挑战的用户
查看代码
大杯椰奶果茶
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
颓废小牛
2022-11-09 18:32:02
相关试题
在下列表述中,错误的是()
字符串
树
排序
评论
(43)
6个不同式样的珠子,可以串联成()...
产品
运营
游戏策划
设计
牛客
财务
审计
税务服务
风险管理
证券分析师
理财顾问
柜面服务
营销
项目助理
评论
(1)
来自
牛客模拟卷—行测篇A卷
Linux 中有一个文件夹为 wo...
Linux
Linux
评论
(1)
以下关于 flex 属性说法正确的是()
CSS
评论
(1)
一个 position: abso...
CSS
评论
(1)
数组逆置
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
hdssg
gssdh