Advertisement
josiftepe

Untitled

Mar 24th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4. int main()
  5. {
  6. int m, n;
  7. cin >> m >> n;
  8. int kolku = 0, zbir = 0;
  9. for(int i = m; i <= n; i++) {
  10. if(i % 2 == 0) {
  11. kolku++;
  12. zbir += i;
  13. }
  14. }
  15. cout << kolku << " " << zbir << endl;
  16. return 0;
  17. }
  18. // 1 2 3 0 5 6 7 0 1 2 3 0 9 9 9
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement