#13019: C++ 使用指令碼最快不麻煩


timmy940410 (遊艇)


查看程式碼 #3541652

a022. 迴文
#include<iostream>
#include<string>
#include<algorithm> 
using namespace std;
int main(){
	string a;
	while(cin>>a){
		string b;
		b=a;
		reverse(b.begin(),b.end());
		if(b==a){
			cout<<"yes"<<endl;
		}else{
			cout<<"no"<<endl;
		}
	}
}
Close
CPP

 

#16657: Re:C++ 使用指令碼最快不麻煩


duncan103015 (錦毛爺)


查看程式碼 #3541652

a022. 迴文
#include
#include
#include 
using namespace std;
int main(){
	string a;
	while(cin>>a){
		string b;
		b=a;
		reverse(b.begin(),b.end());
		if(b==a){
			cout<<"yes"<<endl;
		}else{
			cout<<"no"<<endl;
		}
	}
}
Close
CPP

 

厲害