题解 | #买房子#
买房子
https://www.nowcoder.com/practice/a4b46b53773e4a8db60b5f7629ce03e9
#include<cstdio> int main(){ int N, K; while (scanf("%d %d", &N, &K) != EOF){ float V = 200; int s=N; int i = 0; for (; i < 21; i++){ if (s >= V){ printf("%d\n", i+1); break; } V = V+V*K/100; s = s+N; } if (i == 21){ printf("Impossible\n"); } } }