Advertisement
Guest User

lab64

a guest
Oct 31st, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6. int first, second, third, max, less;
  7.  
  8. cout << "Enter your three test scores: ";
  9. cin >> first >> second >> third;
  10.  
  11. if ( first > second)
  12. {
  13. first = max;
  14. else
  15. if ( second > third)
  16. {
  17. second = max;
  18. else
  19. if ( third > first )
  20. {
  21. third = max;
  22. else
  23. if ( first < second )
  24. {
  25. first = less;
  26. else
  27. if ( second > third )
  28. {
  29. second = less;
  30. }
  31. else
  32. third = less;
  33. }
  34. }
  35. }
  36. }
  37. cout << "The sum of your best two scores is: " << max + less << endl;
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement