1131 - Divisors
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Re: 1131 - Divisors
How are we supposed to know when does the program terminate!?!?!?!?




Re: 1131 - Divisors
In these cases most of the time you should read until the end of file(EOF)laygr wrote:How are we supposed to know when does the program terminate!?!?!?!?![]()
![]()
Java example:
Code: Select all
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = "";
while((line = reader.readLine()) != null) {
// do something
}
Code: Select all
int a,b;
while(scanf("%d%d",&a,&b)!= EOF)
{
//do something
}