Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int m, n;
- cin >> m >> n;
- int zbir = 0;
- for(int i = 1; i <= n; i += 1) {
- int smrk = 0;
- if(i % 3 == 1) {
- smrk = 1;
- }
- else if(i % 3 == 2) {
- smrk = 2;
- }
- else if(i % 3 == 0) {
- smrk = 3;
- }
- if(i > m) {
- zbir += smrk;
- }
- }
- cout << zbir << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement