题解 1031: [编程入门]自定义函数之字符串反转

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

C++简单解法

摘要:#include#includeusing namespace std;int str(char a[],char b[]){ int i=0,n; n=strle……

用stl超级简单

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string a,b; cin>>a,b; reverse(……

四种方法求解字符串反转

摘要:解题思路:关于sizeof(),strlen(),length(),size()char a[100]:定义一个字符数组(使用sizeof和strlen时需要用char定义字符数组)cin>>a;用于……

利用指针解决字符数组

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int main(){    string str;    g……

c++指针法(指针练习)

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){ char arr[100]; cin.getline(arr,100……

自定义函数之字符串反转

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ char a[1000]; cin>>a; for(int ……

偷了个懒直接调用c++的库函数reverse了

摘要:解题思路:直接偷懒了注意事项:个人建议如果用c写尽量注意char *的结束标志,char []没有结束标志参考代码:#include<bits/stdc++.h> using namespace st……