#include <string>#include <iostream>
using namespace std;
// TODO: Define a generic method called CheckOrder() that// takes in four variables of generic type asarguments.// The return type of the method isinteger
// Check the order of the input: return -1 forascending, // 0 for neither, 1 for descending
int main() { // Read in four strings string stringArg1, stringArg2, stringArg3,stringArg4; cin >> stringArg1; cin >> stringArg2; cin >> stringArg3; cin >> stringArg4; // Check order of four strings cout << "Order: " <<CheckOrder(stringArg1, stringArg2, stringArg3, stringArg4) <<endl;
// Read in four doubles double doubleArg1, doubleArg2, doubleArg3,doubleArg4; cin >> doubleArg1; cin >> doubleArg2; cin >> doubleArg3; cin >> doubleArg4; // Check order of four doubles cout << "Order: " <<CheckOrder(doubleArg1, doubleArg2, doubleArg3, doubleArg4) <<endl; return 0;}
#include #include using namespace std; // TODO: Define a generic method called CheckOrder() that //
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am