Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
在我电脑上完全正确啊,怎么就wrong了呢,高手看看哪里问题吧#include<iostream.h>//3302 #include<stdio.h> void main() { int n,m=0; cin>>n; for(int v=0;v<n;v++) { char a[100],b[100],*p,*q; scanf("%s",a); scanf("%s",b); p=a; q=b; while(*q!='\0'&&*p!='\0') { if(*p==*q) { p++;q++; } else p++; } if(*q!='\0') { m=1; } else { while(*p!='\0') p++; } p--;q=b; while(q!='\0'&&p>=a) { if(*p==*q) { p--;q++; } else p--; } if(*q=='\0'||m==0) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator