首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
泰古tae
2020年6月17日 18:28
1006 字符串翻转
P1006
回复 0
|
赞 1
|
浏览 11.8k
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int len=s.size(); for(int i=len-1;i>=0;i--){ cout<<s[i]; } ...
烟杨绿未成
2020年5月8日 09:53
用俩字符数组,第二个数组存第一个数组的倒序字符
P1006
回复 0
|
赞 0
|
浏览 11.0k
#include<iostream> #include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> #include<map> using namespace std; int main() { char s[100], t[100]; gets(s); int len = strlen(s); ...
ymw1836828452
2020年5月1日 10:24
题解
P1006
回复 0
|
赞 0
|
浏览 9.1k
#include <stdio.h> #include <stdlib.h> int main() { char c[100],b[100]; gets(c); int i,j=0; for(i=0;c[i]!='\0';i++) j++; for(i=0;c[i]!='\0';i++) { &nbs...
莫小七
2020年2月21日 12:37
1006反转字符串
P1006
回复 0
|
赞 0
|
浏览 11.4k
#include<iostream> #include<algorithm> using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end());//反转函数 cout << s; return 0; } 不知道这么写可以不,还是题目想要自己动手实现字符串反转!
创世的背影
2019年12月4日 17:11
字符串反转
P1006
回复 2
|
赞 3
|
浏览 13.9k
#include<stdio.h> void main() { char a[100],c; int i; scanf("%s",a); for(i=0;(c=a[i])!='\0';i++) { } i=i-1; for(;i>-1;i--) {  ...
codesuc
2020年3月5日 16:22
翻转字符串
P1006
回复 0
|
赞 0
|
浏览 10.7k
#include<stdio.h> #include<string.h> int main(){ char a[100],b[100]; int L,i,j; gets(a); L=strlen(a); j=L; for(i=0;i<L;i++){ b[--j]=a[i]; } puts(b); return 0; }
猛士骁将
2020年3月29日 17:13
递归实现字符串反转(c语言)
P1006
回复 0
|
赞 2
|
浏览 16.8k
#include <stdio.h> void PrintReverseString() { char c; scanf("%c", &c); if ('\n' == c) return; else { &nbs...
wugenqiang
2020年3月29日 20:28
P1006 - 字符串翻转 - C
P1006
回复 0
|
赞 1
|
浏览 13.7k
/*给定一个字符串,反序输出。*/ #include <stdio.h> #include <string.h> #define N 100 int main(){ char s[N]; gets(s); int i,len = strlen(s); for(i=len-1;i>=0;i--){ printf("%c",s[i]); } return 0; }
猛士骁将
2020年3月12日 17:06
1006 - 字符串翻转(C语言)
P1006
回复 0
|
赞 4
|
浏览 10.9k
我觉得此题想考查的是栈的应用 #include <stdio.h> #include <string.h> int main() { char s[100] = {'0'}, c; int top = 0; while (scanf("%c", &c) != EOF && c != '\n') { ...
谦虚使人进步
2020年1月16日 09:29
这是我第一遍想到的结果,还没想有没有更好的,写完全部有时间再做一遍
P1006
回复 0
|
赞 0
|
浏览 11.6k
#include <iostream> #include <cstring> #include <string> using namespace std; int main() { string str; cin >> str; for(int i=str.length()-1;i>=0;i--){ cout << str[i...
1
2
3
4
5
题目
字符串翻转
题解数量
41
发布题解
在线答疑
热门题解
1
字符串翻转 题解:fgets函数会读取换行符 注意字符串长度要多减一个
2
字符串翻转 题解:
3
字符串翻转 题解:假如你没听说过reverse()
4
字符串翻转 题解:getline
5
字符串翻转 题解:
6
字符串翻转 题解:C++
7
字符串翻转 题解:string length
8
字符串翻转 题解:
9
字符串翻转 题解:C
10
字符串翻转 题解:C++