- 论坛徽章:
- 0
|
#include <stdio.h>
int main(int argc, char *argv[]) {
double rope_length, snail_crawled, z;
unsigned long i;
rope_length = 1000.0;
snail_crawled = 0.0;
i = 1;
while(snail_crawled <= rope_length) {
snail_crawled += 1.0;
z = rope_length / (rope_length + 100.0);
snail_crawled /= z;
rope_length += 1000.0;
i++;
}
fprintf(stderr, "%lu\n", i);
return 0;
}
|
|
|