首页
DreamJudge
院校信息
考研初试
机试真题
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
wugenqiang
2020年3月29日 20:28
P1006 - 字符串翻转 - C
P1006
回复 0
|
赞 1
|
浏览 13.2k
/*给定一个字符串,反序输出。*/ #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.4k
我觉得此题想考查的是栈的应用 #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.2k
#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...
A1120161820
2020年3月18日 16:00
字符串翻转(c++)
P1006
回复 0
|
赞 1
|
浏览 12.3k
#include<iostream> #include<stack> using namespace std; int main() { string s; cin >> s; for (int i = s.length()-1; i >= 0; i--) { cout << s[i]; } cout << endl; return 0; }
1
2
3
4
题目
字符串翻转
题解数量
34
发布题解
在线答疑
热门题解
1
字符串翻转 题解:fgets函数会读取换行符 注意字符串长度要多减一个
2
字符串翻转 题解:
3
字符串翻转 题解:假如你没听说过reverse()
4
字符串翻转 题解:getline
5
字符串翻转 题解:
6
字符串翻转 题解:
7
字符串翻转 题解:C
8
字符串翻转 题解:C++
9
字符串翻转 题解:string length
10
字符串翻转 题解: