Advertisement
kirya_shkolnik

Untitled

May 15th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. // 25 задание пробник 2018г
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. const int N=2018;
  7. int main(){
  8.     int a[N];
  9.     int i,k,m;
  10.     for(i = 0; i < N; ++i)
  11.         cin >> a[i];
  12.     m = 15001; 
  13.     for(i = 0; i < N; ++i)
  14.         if (a[i] < m and a[i]%3==0) m = a[i];
  15.     for(i = 0; i < N; ++i){
  16.         if(a[i] % 2 == 0 and m!=15001) a[i] = a[i] - m;
  17.         cout << a[i] << endl;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement