#875: 題目的終止條件是什麼搞不懂


bird (GG)

學校 : 长郡中学
編號 : 2681
來源 : [111.255.206.95]
最後登入時間 :
2010-10-23 20:18:46
c045. 00490 - Rotating Sentences -- UVa490 | From: [140.117.182.115] | 發表日期 : 2008-11-05 10:46

#include<iostream>
#define max 100
using namespace std;
struct stack
{
    char a[max+1];
};
typedef struct stack stk;
int main()
{
    stk obj[max];
    int j=0,maxi=0;

    for(int i=0;i<2;i++){
    cin.get(obj[i].a,max);
    if(strlen(obj[i].a)>maxi)
    maxi=strlen(obj[i].a);
    getchar();}
    for(int j=0;j<maxi;j++){
        for(int i=1;i>=0;i--){
            if(obj[i].a[j]=='\0')
            continue;
            cout<<obj[i].a[j];
        }
        cout<<endl;
    }
    system("pause");
    return 0;
}
 
#876: Re:題目的終止條件是什麼搞不懂


snail (蝸牛)

學校 : 新北市立板橋高級中學
編號 : 2021
來源 : [203.64.161.123]
最後登入時間 :
2024-10-16 10:38:18
c045. 00490 - Rotating Sentences -- UVa490 | From: [220.133.52.85] | 發表日期 : 2008-11-05 11:59

以 EOF 為結束,最多有 100 行喔! 
ZeroJudge Forum