Advertisement
Joporezka1

2

May 13th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. //
  2. //  2.cpp
  3. //  12
  4. //
  5. //  Created by Алексей on 23/10/2018.
  6. //  Copyright © 2018 Алексей. All rights reserved.
  7. //
  8. #include <iostream>
  9. #include <math.h>
  10. #include <cmath>
  11. #include <stdio.h>
  12. using namespace std;
  13. int main(){
  14.     int minim=0, maxim=0, a;
  15.     while(true){
  16.         cin>>a;
  17.         if(a==0){
  18.             break;
  19.         }
  20.         if(a>maxim){
  21.             maxim=a;
  22.         }
  23.         if(a<minim){
  24.             minim=a;
  25.         }
  26.        
  27.     }
  28.     cout<<minim+maxim;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement