1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include using namespace std; int main() { int N; double somme; cout << "Entrer un entier : " ; cin >> N; if (N>=5) { for ( int i=5; i<=N; i++) somme += i*i*i; } cout << "Somme des cubes de 5^3 a " << N << "^3 = " << somme << endl; cin.ignore(); cin.get(); return EXIT_SUCCESS; } |
- Sunday
- May 18th, 2025
- Ajouter un cours