#20424: WHY WA??


andyvip0124@gmail.com (侯昱彰)

School : 國立嘉義高級中學
ID : 111315
IP address : [101.9.174.169]
Last Login :
2023-09-28 16:56:38
a861. 1. Secure the Perimeter -- HP CodeWars2010 | From: [125.227.98.81] | Post Date : 2020-01-20 10:32

#include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
while (cin>>H>>W){
cout<<(H+W)*2;
}
}

 

請幫我看一下會什麼測資會出現WA

 
#20482: Re:WHY WA??


a22671512 (夢之旋律)

School : 國立新營高級中學
ID : 53576
IP address : [220.135.123.130]
Last Login :
2024-02-14 21:30:50
a861. 1. Secure the Perimeter -- HP CodeWars2010 | From: [118.232.124.148] | Post Date : 2020-01-29 20:35

#include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
while (cin>>H>>W){
cout<<(H+W)*2;
}
}

 

請幫我看一下會什麼測資會出現WA


你的兩筆輸出間少了換行
他會全部黏在一起

cout<<(H+W)*2<<endl;

 
ZeroJudge Forum