Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int N=2020;
- int main(){
- int a[N];
- int i,m,k;
- for(i=0; i<N; ++i){
- cin >> a[i];
- }
- m=-1;
- for(i=0; i<N; ++i){
- if(a[i] % 2 != 0 and a[i] < 1000 and a[i] > m){
- m = a[i];
- }
- }
- k = 1000 / m;
- if( k*m <= 1000 ) k++;
- for(i=0; i<N; ++i){
- if(a[i] % 2 != 0 and a[i] < 1000){
- a[i] = a[i] * k;
- }
- cout << a[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement