Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int first, second, third, max, less;
- cout << "Enter your three test scores: ";
- cin >> first >> second >> third;
- if ( first > second)
- {
- first = max;
- else
- if ( second > third)
- {
- second = max;
- else
- if ( third > first )
- {
- third = max;
- else
- if ( first < second )
- {
- first = less;
- else
- if ( second > third )
- {
- second = less;
- }
- else
- third = less;
- }
- }
- }
- }
- cout << "The sum of your best two scores is: " << max + less << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement