努力赶C++作业中
emmmmm,不是那一条攻略,是你后面发的那条,你要在每道题目都发元神的链接,我喊你别发。。。
#include #include using namespace std;
int main(){ string s; cin>>s; int len = s.length(); for(int i=0;i<len;i++){ if(s[i] !=s[len-i-1]){ cout<<"no"; return 0; } } cout<<"yes"; return 0; } //长度:strlen //cout<<s1.length(); //拼接:strcat //string s2 = "abc"; //string s3 = "123"; //cout<<s2+s3; //复制:strspy //string s4 = s1; //cout<<s4; //比较:strcmp //cout<<(s2>s3);
C:/Users/tc/Pictures/v2-4b666712837abc5a639087771f3083f9_r.jpg
file:///C:/Users/tc/Pictures/v2-4b666712837abc5a639087771f3083f9_r.jpg
共 30 条回复
努力赶C++作业中
emmmmm,不是那一条攻略,是你后面发的那条,你要在每道题目都发元神的链接,我喊你别发。。。
#include #include using namespace std;
int main(){ string s; cin>>s; int len = s.length(); for(int i=0;i<len;i++){ if(s[i] !=s[len-i-1]){ cout<<"no"; return 0; } } cout<<"yes"; return 0; } //长度:strlen //cout<<s1.length(); //拼接:strcat //string s2 = "abc"; //string s3 = "123"; //cout<<s2+s3; //复制:strspy //string s4 = s1; //cout<<s4; //比较:strcmp //cout<<(s2>s3);
C:/Users/tc/Pictures/v2-4b666712837abc5a639087771f3083f9_r.jpg
#include #include using namespace std;
int main(){ string s; cin>>s; int len = s.length(); for(int i=0;i<len;i++){ if(s[i] !=s[len-i-1]){ cout<<"no"; return 0; } } cout<<"yes"; return 0; } //长度:strlen //cout<<s1.length(); //拼接:strcat //string s2 = "abc"; //string s3 = "123"; //cout<<s2+s3; //复制:strspy //string s4 = s1; //cout<<s4; //比较:strcmp //cout<<(s2>s3);
file:///C:/Users/tc/Pictures/v2-4b666712837abc5a639087771f3083f9_r.jpg