蝸牛翻牆

 avatar
user_3763047219
c_cpp
2 years ago
300 B
1
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
int main()
{
	int a = 0, b = 0, c = 0, d = 0;
	int day = 1;
	scanf("%d %d %d %d", &a, &b, &c, &d);
	while (b <= a) {
		b = b + c;
		if (b >= a) {
			printf("%d", day);
			break;
		}
		else {
			b = b - d;
		}
		day = day + 1;
	}
}