#9120: 為什麼會WA line:3 輸出短小?


g15927 (bobo)


#include<iostream>
#include<string>
using namespace std;
int main()
{
    string x="",y="";
    getline(cin,x);

    int i=0;
    while(i<x.length())
    {     
     x[i]=x[i]-7;
     cout<<x[i];
     i++;
    }
    cout<<'\n';
    getline(cin,y);
    i=0;
    while(i<y.length())
    {     
     y[i]=y[i]-7;
     cout<<y[i];
     i++;
    }

    return 0;   
}
 
 為什會說共輸出兩行 輸出短小? 答案不是就兩行嗎? 測試都是對的