Search found 2 matches

by nachopol
Wed May 16, 2007 2:50 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319833

EOF

The problem was in the loop. It should be:
while (scanf("%ld %ld",&n0,&n1)!=EOF)
by nachopol
Wed May 16, 2007 10:25 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319833

100 - Time Exceeded (?)

Hi. I've received a time exceeded (10.025 seconds) when in other computers, the program takes 0 seconds. Could it be the entrance mode? Here is the code. Thanks in advance:
#include "stdio.h"
void main(){
long n,i,x,n0,n1,mc,c=1;
while (scanf("%ld %ld",&n0,&n1)) {
printf ("%ld %ld ",n0,n1);
mc=1 ...

Go to advanced search