Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // Rules:
- // User will enter in 4 numbers: a, b, c, d
- // a > b, b < c, c = d
- int main() {
- int num1,
- num2,
- num3,
- num4;
- bool success = false;
- while (!success) {
- cout << "Enter 4 numbers." << endl;
- cout << "(1): ";
- cin >> num1;
- cout << "(2): ";
- cin >> num2;
- cout << "(3): ";
- cin >> num3;
- cout << "(4): ";
- cin >> num4;
- if (num1 > num2) {
- cout << "The first number looks good!" << endl;
- success = true;
- }
- else {
- cout << "The first number needs some fixing..." << endl;
- success = false;
- }
- if (num2 < num3) {
- cout << "The second number looks good!" << endl;
- success = true;
- }
- else {
- cout << "The second number needs some fixing..." << endl;
- success = false;
- }
- if (num3 == num4) {
- cout << "The third number looks good!" << endl;
- success = true;
- }
- else {
- cout << "The third number needs some fixing..." << endl;
- success = false;
- }
- if (num4 == num3) {
- cout << "The fourth number looks good!" << endl;
- success = true;
- }
- else {
- cout << "The fourth number needs some fixing..." << endl;
- success = false;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment