a) #include using namespace std; int main(int argc, char **argv) { float U = 1; cout << "U0 = " << U << endl; for (int n = 1; n <= 10; n++) { U = U / n; cout << "U" << n << " = " << U << endl; } return 0; } b) #include using namespace std; int main(int argc, char **argv) { float U = 1; float V = U; cout << "U0 = " << U << endl; for (int n = 1; n <= 10; n++) { U = U / n; V = V + U; cout << "U" << n << " = " << U << endl; cout << "V" << n << " = " << V << endl; } return 0; }
- Sunday
- November 3rd, 2024
- Ajouter un cours