Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int a, b, x;
- x=0;
- while (cin >> a >> b) {
- x=0;
- cout << "suma dels cubs entre " << a << " i " << b << ": ";
- while (a<b) {
- x+=(a*a*a);
- a++;
- }
- if (a<=b) x+=(a*a*a);
- cout << x << endl;
- }
- }
Add Comment
Please, Sign In to add comment