首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
FCC
2024年3月14日 21:29
字符串翻转 题解:reverse()函数
P1006
回复 0
|
赞 4
|
浏览 1.3k
#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
|
浏览 1.4k
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
|
赞 14
|
浏览 1.8k
#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
|
赞 22
|
浏览 1.8k
#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
|
浏览 3.4k
#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
|
浏览 2.4k
#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
|
浏览 6.5k
#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
|
浏览 4.0k
#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++; &...
江离
2021年6月15日 20:01
c++实现
P1006
回复 0
|
赞 2
|
浏览 9.8k
#include<stdio.h> #include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ string str; cin>>str; reverse(str.begin(),str.end()); cout<<str&l...
未央
2021年5月31日 22:35
1006 字符串翻转
P1006
回复 0
|
赞 4
|
浏览 9.7k
#include<stdio.h> #include<string.h> int main() { int i, j; char a[100] = {0}; scanf("%s", a); for(i = strlen(a); i > 0; i--)//strlen(a) 返回字符串 s1 的长度 {  ...
1
2
3
4
5
题目
字符串翻转
题解数量
42
发布题解
在线答疑
热门题解
1
字符串翻转 题解:fgets函数会读取换行符 注意字符串长度要多减一个
2
字符串翻转 题解:手写reverse
3
字符串翻转 题解:假如你没听说过reverse()
4
字符串翻转 题解:
5
字符串翻转 题解:C
6
字符串翻转 题解:getline
7
字符串翻转 题解:
8
字符串翻转 题解:string length
9
字符串翻转 题解:C++
10
字符串翻转 题解: