Advertisement
hungkt1997

ktlt-lab6.1

May 5th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1.  
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. float SoLonHon(float a, float b){
  7. float Max = a;
  8. if (Max <= b) Max = b;
  9. return Max;
  10. }
  11.  
  12. void Slove(){
  13.  
  14. //Khai bao
  15. float a, b;
  16.  
  17. //Input
  18. cout << "Nhap so thuc a: ";
  19. cin >> a;
  20. cout << "Nhap so thuc b: ";
  21. cin >> b;
  22.  
  23. //Output
  24. cout << "So lon nhat giua hai so "<<a<<" va "<<b<<" la "<< SoLonHon(a,b)<<"" << endl;
  25. }
  26.  
  27. int main(){
  28.  
  29. Slove();
  30. system("pause");
  31. return EXIT_SUCCESS;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement