Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- void start();
- int main(){
- start();
- system("pause");
- return 0;
- }
- void start(){
- int N, x, max = -1, chek, iMem, jMem;
- cin >> N;
- vector <int> mem(N);
- for (int r = 0; r<N; r++){
- cin >> x;
- mem[r] = x;
- }
- for (int i = 0; i<N; i++){
- for (int j = 0; j<N; j++){
- if (i!=j){
- if ( (mem[i]+mem[j])%2!=0 && mem[i]*mem[j]%5 == 0){
- chek = mem[i]*mem[j]%5;
- if (chek>=max){
- iMem = i;
- jMem = j;
- }
- }
- }
- }
- }
- cout << mem[iMem] << " " << mem[jMem] << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement