1368:对称二叉树(tree_c)

对称二叉树

#include<iostream>
#include<cstring>
using namespace std;

int main(){
    string s;
    cin>>s;
    int len=s.length();
    if(!len)cout<<"Yes";
    else{
        int pt=1;
        while(pt<len){
            if(pt+1==len||s[pt]=='#'&&s[pt+1]!='#'||s[pt]!='#'&&s[pt+1]=='#')break;
            pt+=2;
        }
        if(pt<len)cout<<"No";
        else cout<<"Yes";
    }   
	return 0;
}
上一篇:TZOJ:3789: Process the Tasks


下一篇:Double与BigDecimal 比较