Back
KT1.cpp
Save
// KT1.cpp #include
using namespace std; int main() { float e = 0.00001; float a, s1, s2; do { cout<<"Nhap a: "; cin>>a; } while (a <= 0); s2 = a; do { s1 = s2; s2 = (s1 * s1 + a)/(2 * s1); } while (fabs((s2 - s1) / s1) >= e); cout<<"Tim duoc can bac 2 cua "<