#8845: 為什麼一直TLE?


frank73255 (ya~~)


#include <iostream>
#include <cstdlib>
#include <stdio.h>
using namespace std;
int main()
{
int  h, w;
while(1){

scanf("%d %d", &h, &w);
printf("%d\n", 2*h+2*w);



}
return 0;
}
 
 為什麼一直TLE???請各位大大幫幫忙><!!
#8860: Re:為什麼一直TLE?


b821213 (後繼無人)



while(1){

 
因為你這句,他會永遠讀個沒停。我想你需要的也許是判斷 EOF 而不是無限地讀取?