Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int A;
- int B;
- int sum = 0;
- cin >> A >> B;
- for(int i = A;i <= B;i++){
- sum += i;
- if (sum / 5 == 0) {
- cout << sum << endl;
- }else if (sum / A == 0|| sum / B == 0)
- cout << sum << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement