-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceed.cpp
More file actions
34 lines (26 loc) · 797 Bytes
/
exceed.cpp
File metadata and controls
34 lines (26 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#define ZERO 0
#include <climits>
int main()
{
using namespace std;
short sam = SHRT_MAX;
unsigned short sue = sam;
cout << "Sam has " << sam << "dollars and sue has" << sue;
cout << " dollars deposited." << endl
<< " Add $1 to each account." << endl << "Now ";
sam = sam + 1;
sue = sue + 1;
cout << "Sam has " << sam << " dollars and Sue has " << sue;
cout << " dollars deposited.\n Poor sam!" << endl;
sam = ZERO;
sue = ZERO;
cout << "Sam has" << sam << " dollars and Sue has " << sue;
cout << " dollars deposited." << endl;
cout << "Take $1 from each account " << endl << "Now ";
sam = sam - 1;
sue = sue - 1;
cout << "Sam has " << sam << "dollars and Sue has " << sue;
cout << " dollars deposited." << endl << "Lucky Sue!" << endl;
return 0;
}