Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("2lap.in");
- ofstream fout("2lap.out");
- int v[101];
- int main()
- {
- int N, M, i=1, cnt=1, produs=1, K1, K2, K=0;
- fin>>N;
- fin>>M;
- while(fin>>v[cnt])
- {
- cnt++;
- }
- for(int i=0; i<cnt-1; i++)
- {
- for(int j=i+1; j<cnt; j++)
- {
- if(v[i]>v[j])
- {
- swap(v[i], v[j]);
- }
- }
- }
- K1=v[N];
- K2=v[M];
- fout<<K1<<" "<<K2<<"\n";
- for(i=N+1; i<M; i++)
- {
- produs=produs*v[i];
- }
- while(produs%2==0)
- {
- produs=produs/2;
- K++;
- }
- fout<<K<<"\n";
- for(i=N+1; i<M; i++)
- fout<<v[i]<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement