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