Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- int now = 0, a = 0, b = 0;
- ifstream input("C:\\Users\\Максим\\Downloads\\27986_B.txt");
- while (input >> now && now != 0) {
- if (now % 7 == 0 && now % 49 != 0 && now > a) {
- a = now;
- }
- else if (now % 7 != 0 && now > b) {
- b = now;
- }
- }
- cout << ((a * b == 0) ? 1 : a * b);
- }
Advertisement
Add Comment
Please, Sign In to add comment