首页
DreamJudge
院校信息
考研初试
机试真题
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
渐鸿于陆
2024年3月16日 21:17
字符串翻转 题解:
P1006
回复 0
|
赞 20
|
浏览 1.6k
#include"stdio.h" #include"stdlib.h" #include"string.h" int main(void){ char s[105] = {0}; gets(s); int len = strlen(s); for(int i = len-1;i>=0;i--){  ...
928上岸梦校!
2023年8月6日 12:27
STL容器的逆序输出
P1006
回复 3
|
赞 7
|
浏览 1.7k
C++参考代码如下: #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (auto it = s.rbegin(); it != s.rend(); it++) { cout << *it; } return 0; }
FCC
2024年3月14日 21:29
字符串翻转 题解:reverse()函数
P1006
回复 0
|
赞 2
|
浏览 884
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; reverse( s.begin(), s.end() ); //字符串迭代器 cout << s; return 0; }
小酒
2024年3月11日 15:50
字符串翻转 题解:
P1006
回复 0
|
赞 1
|
浏览 956
1006解题思路 #include <bits/stdc++.h> using namespace std; int main() { char a[100]; char k; int i=0; gets(a); while(!a[i]==0) { i...
williams
2024年3月8日 16:50
字符串翻转 题解:
P1006
回复 0
|
赞 11
|
浏览 1.1k
#include <stdio.h> #include <string.h> int main(void){ char s[100]; gets(s); for(int i=strlen(s)-1;i>=0;i--) printf("%c",s[i]); return 0; }
lingdongyang
2024年3月7日 10:18
字符串翻转 题解:C
P1006
回复 0
|
赞 10
|
浏览 1.0k
#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { char s[105]; scanf("%s", &s); int len = strlen(s); for (int i = len - 1; i >= 0; i--) { printf("%c", s[i]); } return 0; }
红星闪闪
2023年7月9日 19:17
字符串翻转 题解:
P1006
回复 1
|
赞 6
|
浏览 2.3k
#include<stdio.h> #include<string.h> int main(){ char c[101]; gets(c); int n=strlen(c); for(int i=n-1;i>=0;i--){ printf("%c",c[i]);  ...
猪蹄子全是肉
2023年5月4日 16:19
字符串翻转 题解:
P1006
回复 0
|
赞 3
|
浏览 1.8k
#include <iostream> #include <algorithm> #include <cmath> #include <cstring> using namespace std; char s[110]; // 定义 char 类型数组 s,用于存储字符串 int main() { scanf("%s", s); // 使用 scanf 输入字符串 s int len = strlen(s); // 计...
jhsf
2023年2月27日 16:59
reverse翻转
P1006
回复 0
|
赞 1
|
浏览 5.3k
#include<bits/stdc++.h> using namespace std; int main(){ char a[100]; string s; cin>>s; int b=s.size(); for(int i=0;i<b;i++){ a[i]=s[i]; } reverse(a,a+b); for(int i=0;i<b;i++){ cout<<a[i]; } return 0; }
huangdashuaige
2023年2月15日 21:24
P1006题解
P1006
回复 0
|
赞 1
|
浏览 3.2k
#include <iostream> using namespace std; int main( ) { char str[100]; //变量定义:字符类型,也可以用string str; cin>>str; //字符串输入 int i=0; //引入i,用于求str的长度,若是使用string,可用size()函数直接得到 while(str[i]!='\0') i++; &...
1
2
3
4
题目
字符串翻转
题解数量
34
发布题解
在线答疑
热门题解
1
字符串翻转 题解:fgets函数会读取换行符 注意字符串长度要多减一个
2
字符串翻转 题解:
3
字符串翻转 题解:假如你没听说过reverse()
4
字符串翻转 题解:getline
5
字符串翻转 题解:
6
字符串翻转 题解:
7
字符串翻转 题解:C
8
字符串翻转 题解:C++
9
字符串翻转 题解:string length
10
字符串翻转 题解: