Re: No, there is not! Message #5 Posted by Gerson W. Barbosa on 3 July 2011, 2:30 p.m., in response to message #4 by Marcus von Cube, Germany
Yes, it would :-) And it would make for an extremely short wp34s program.
BTW at least a couple of optimized C solutions there follow that approach:
#include <stdio.h>
int main()
{
int i;
for (i = 1; i * i <= 100; i++)
printf("door %d open\n", i * i);
return 0;
}
#include <iostream> //compiled with "Dev-C++" , from RaptorOne
int main()
{
for(int i=1; i*i<=100; i++)
std::cout<<"Door "<<i*i<<" is open!"<<std::endl;
}
A mathematical explanation, in Spanish:
http://gaussianos.com/el-problema-de-las-100-puertas-y-los-divisores-de-un-numero-natural/
Edited: 3 July 2011, 2:36 p.m.
|