#30850: 這裡AC但在UVa WA,求救


d10831523@gapps.fg.tp.edu.tw (廖與僑)


如標題

 

#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";
    }
}

 

#30853: Re: 這裡AC但在UVa WA,求救


linlincaleb@gmail.com (臨末之頌)


如標題

 

#include
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 "<
        la=a.length(),lb=b.length();
        f=1;
        int i=0,j=0;
        while(f&&i
            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";
    }
}

 

 

好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer

#30854: Re: 這裡AC但在UVa WA,求救


ccbclup (ccbclup)


如標題

 

#include
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 "<
        la=a.length(),lb=b.length();
        f=1;
        int i=0,j=0;
        while(f&&i
            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";
    }
}

 

 

好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer

你真厲害,😎

#30856: Re: 這裡AC但在UVa WA,求救


fire5386 (becaidorz)


 

 

好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer


瓜張 有崽崽了還這樣

#30862: Re: 這裡AC但在UVa WA,求救


linlincaleb@gmail.com (臨末之頌)


 

 

好久不見阿 又看到你了 你的問題是行尾空格(ex:"yes " 與"yes"),你的code會輸出wrong answer


瓜張 有崽崽了還這樣

閉嘴啦 死老鼠...