一元二次方程求解
#include<stdio.h> #include<math.h> int main() { long long h; scanf("%lld", &h); long long ans = (-1 + (long long)sqrt(1+4*h))/2; printf("%lld\n", ans); return 0; }
一元二次方程求解
#include<stdio.h> #include<math.h> int main() { long long h; scanf("%lld", &h); long long ans = (-1 + (long long)sqrt(1+4*h))/2; printf("%lld\n", ans); return 0; }