War game/net-force.nl
Programming - 1. keep walking...
badcob
2008. 6. 12. 16:52
Question :
This is a challenge to test your basic programming skills.
Pseudo code:
Set X = 1
Set Y = 1
Set previous answer = 1
answer = X * Y + previous answer + 3
After that => X + 1 and Y + 1 ('answer' becomes 'previous answer') and repeat this till you have X = 525.
The final answer is the value of 'answer' when X = 525. Fill it in below to check if it's the correct answer. If it is, you will get the password for the challenge page.
answer :
#include <stdio.h>
void main(void)
{
int x=1, y=1;
int answer = 1;
for(;x<526;)
{
answer = (x++) * (y++) + answer + 3;
if(x==524)
printf("\nprevious answer = %d", answer);
}
printf("\nx=%d, y=%d\nanswer = %d",x,y,answer);
return;
}
enter : 48373851
Nice one, the password is: pr0ggen