does @begin_of_source work
Posted: Sat Jun 07, 2003 12:05 am
does
@BEGIN_OF_SOURCE and @END_OF_SOURCE actually work
If so then why did I recieve an email that looks like this
--------------------------------------------------------------------------------------
Dear Syn:
You are trying to solve "The 3n + 1 problem" (problem 100).
I have received and stored your C++ program. It will be compiled and run
as soon as possible; please be patient waiting for the results...
--
The Online Judge
--------------- The program I'll compile begins here: ---------------
This is a multi-part message in MIME format.
------=_NextPart_000_0153_01C32C4D.EE0BA3B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
@BEGIN_OF_SOURCE
/* @JUDGE_ID: {MYNUM} 100 C++ */
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
long cycleLength( long number );
int main()
{
long first, second;
while( cin >> first >> second )
{
long smallest, largest;
if( first < second )
{
smallest =3D first;
largest =3D second;
}
else
{
largest =3D first;
smallest =3D second;
}
long max =3D 0;
for( int C =3D smallest; C <=3D largest; C++ )
{
long temp;
temp =3D cycleLength( C );
if( temp > max )
max =3D temp;
}
cout << first << ' ' << second << ' ' << max << endl;
}
return 0;
}
long cycleLength( long number )
{
long count =3D 1;
while( number > 1 )
{
switch( number % 2 )
{
case 1:
number =3D ( 3 * number ) + 1;
break;
default:
number =3D number / 2;
}
count++;
}
return count;
};
@END_OF_SOURCE
------=_NextPart_000_0153_01C32C4D.EE0BA3B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>@BEGIN_OF_SOURCE</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>/* @JUDGE_ID: 32419FW 100 C++ =
*/<BR>#include=20
&iostream&<BR>using std::cin;<BR>using std::cout;<BR>using=20
std::endl;<BR>long cycleLength( long number );<BR>int =
main()<BR>{<BR>&long=20
first, second;<BR>&while( cin && first && second=20
)<BR>&{<BR>&&long smallest, largest;<BR>&&if( =
first=20
& second )<BR>&&{<BR>&&&smallest =3D=20
first;<BR>&&&largest =3D=20
second;<BR>&&}<BR>&&else<BR>&&{<BR>&&n=
bsp;&largest=20
=3D first;<BR>&&&smallest =3D=20
second;<BR>&&}<BR>&&long max =3D =
0;<BR>&&for( int C=20
=3D smallest; C &=3D largest; C++ =
)<BR>&&{<BR>&&&long=20
temp;<BR>&&&temp =3D cycleLength( C =
);<BR>&&&if(=20
temp & max )<BR>&&&&max =3D=20
temp;<BR>&&}<BR>&&cout && first && ' ' =
&&=20
second && ' ' && max && =
endl;<BR>&}<BR>&return=20
0;<BR>}<BR>long cycleLength( long number )<BR>{<BR>&long count =3D=20
1;<BR>&while( number & 1 )<BR>&{<BR>&&switch( =
number % 2=20
)<BR>&&{<BR>&&case 1:<BR>&&&number =
=3D ( 3 *=20
number ) +=20
1;<BR>&&&break;<BR>&&default:<BR>&&&nb=
sp;number=20
=3D number /=20
2;<BR>&&}<BR>&&count++;<BR>&}<BR>&return=20
count;<BR>};<BR><BR>@END_OF_SOURCE</FONT></DIV></BODY></HTML>
------=_NextPart_000_0153_01C32C4D.EE0BA3B0--
@BEGIN_OF_SOURCE and @END_OF_SOURCE actually work
If so then why did I recieve an email that looks like this
--------------------------------------------------------------------------------------
Dear Syn:
You are trying to solve "The 3n + 1 problem" (problem 100).
I have received and stored your C++ program. It will be compiled and run
as soon as possible; please be patient waiting for the results...
--
The Online Judge
--------------- The program I'll compile begins here: ---------------
This is a multi-part message in MIME format.
------=_NextPart_000_0153_01C32C4D.EE0BA3B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
@BEGIN_OF_SOURCE
/* @JUDGE_ID: {MYNUM} 100 C++ */
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
long cycleLength( long number );
int main()
{
long first, second;
while( cin >> first >> second )
{
long smallest, largest;
if( first < second )
{
smallest =3D first;
largest =3D second;
}
else
{
largest =3D first;
smallest =3D second;
}
long max =3D 0;
for( int C =3D smallest; C <=3D largest; C++ )
{
long temp;
temp =3D cycleLength( C );
if( temp > max )
max =3D temp;
}
cout << first << ' ' << second << ' ' << max << endl;
}
return 0;
}
long cycleLength( long number )
{
long count =3D 1;
while( number > 1 )
{
switch( number % 2 )
{
case 1:
number =3D ( 3 * number ) + 1;
break;
default:
number =3D number / 2;
}
count++;
}
return count;
};
@END_OF_SOURCE
------=_NextPart_000_0153_01C32C4D.EE0BA3B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>@BEGIN_OF_SOURCE</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>/* @JUDGE_ID: 32419FW 100 C++ =
*/<BR>#include=20
&iostream&<BR>using std::cin;<BR>using std::cout;<BR>using=20
std::endl;<BR>long cycleLength( long number );<BR>int =
main()<BR>{<BR>&long=20
first, second;<BR>&while( cin && first && second=20
)<BR>&{<BR>&&long smallest, largest;<BR>&&if( =
first=20
& second )<BR>&&{<BR>&&&smallest =3D=20
first;<BR>&&&largest =3D=20
second;<BR>&&}<BR>&&else<BR>&&{<BR>&&n=
bsp;&largest=20
=3D first;<BR>&&&smallest =3D=20
second;<BR>&&}<BR>&&long max =3D =
0;<BR>&&for( int C=20
=3D smallest; C &=3D largest; C++ =
)<BR>&&{<BR>&&&long=20
temp;<BR>&&&temp =3D cycleLength( C =
);<BR>&&&if(=20
temp & max )<BR>&&&&max =3D=20
temp;<BR>&&}<BR>&&cout && first && ' ' =
&&=20
second && ' ' && max && =
endl;<BR>&}<BR>&return=20
0;<BR>}<BR>long cycleLength( long number )<BR>{<BR>&long count =3D=20
1;<BR>&while( number & 1 )<BR>&{<BR>&&switch( =
number % 2=20
)<BR>&&{<BR>&&case 1:<BR>&&&number =
=3D ( 3 *=20
number ) +=20
1;<BR>&&&break;<BR>&&default:<BR>&&&nb=
sp;number=20
=3D number /=20
2;<BR>&&}<BR>&&count++;<BR>&}<BR>&return=20
count;<BR>};<BR><BR>@END_OF_SOURCE</FONT></DIV></BODY></HTML>
------=_NextPart_000_0153_01C32C4D.EE0BA3B0--