如標題
#include<bits/stdc++.h>using namespace std;
int main(){ string a,b; int n,la,lb; bool f; cin>>n; getchar(); for(int t=1;t<=n;t++){ getline(cin,a); getline(cin,b); cout<<"Case "<<t<<": "; la=a.length(),lb=b.length(); f=1; int i=0,j=0; while(f&&i<la&&j<lb){ if(a[i]==' ')i++; else if(a[i]==b[j])i++,j++; else f=0; } if(i+j==la+lb){ if(la==lb)cout<<"Yes\n"; else cout<<"Output Format Error\n"; } else cout<<"Wrong Answer\n"; }}
如標題
#includeusing namespace std;
int main(){string a,b;int n,la,lb;bool f;cin>>n;getchar();for(int t=1;t<=n;t++){getline(cin,a);getline(cin,b);cout<<"Case "<la=a.length(),lb=b.length();f=1;int i=0,j=0;while(f&&iif(a[i]==' ')i++;else if(a[i]==b[j])i++,j++;else f=0;}if(i+j==la+lb){if(la==lb)cout<<"Yes\n";else cout<<"Output Format Error\n";}else cout<<"Wrong Answer\n";}}
好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer
如標題
#includeusing namespace std;
int main(){string a,b;int n,la,lb;bool f;cin>>n;getchar();for(int t=1;t<=n;t++){getline(cin,a);getline(cin,b);cout<<"Case "<la=a.length(),lb=b.length();f=1;int i=0,j=0;while(f&&iif(a[i]==' ')i++;else if(a[i]==b[j])i++,j++;else f=0;}if(i+j==la+lb){if(la==lb)cout<<"Yes\n";else cout<<"Output Format Error\n";}else cout<<"Wrong Answer\n";}}
好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer
你真厲害,😎
好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer
瓜張 有崽崽了還這樣
好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer
瓜張 有崽崽了還這樣
閉嘴啦 死老鼠...