Advertisement
icatalin

9.10 problema 2

Oct 9th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int medie(int a,int b)
  7. {
  8.     int m;
  9.     m=(a+b)/2;
  10. }
  11.  
  12. int main()
  13. {
  14.     int a,b,n,i,max=-9999;
  15.     cout<<"n= ";cin>>n;
  16.     for (i=1;i<=n;i++)
  17.     {
  18.     cout<<"a= ";cin>>a;
  19.     cout<<"b= ";cin>>b;
  20.     if (medie(a,b)>max)
  21.     max=medie(a,b);
  22.     }
  23.     cout<<max;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement