Advertisement
X-88

deret

Dec 2nd, 2021
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int i, x = 0, m = 5;
  5. int main()
  6. {
  7. for (i = 1; i <= m; i++)
  8. {
  9.     x += i;
  10. if (i < m)
  11.     cout << i << " + ";
  12. else
  13.     cout << i << " = " << x << endl;
  14. }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement