Skip to content

Instantly share code, notes, and snippets.

@DVegasa
Last active September 6, 2018 17:20
Show Gist options
  • Save DVegasa/fa3a801a6efb681dd57e7a3456e34701 to your computer and use it in GitHub Desktop.
Save DVegasa/fa3a801a6efb681dd57e7a3456e34701 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
void testIt(int a, int b) {
if (a != b) cout << "\n=== Bad test === \n Expected: " << a << " \n Result: " << b << " \n";
}
void testIt(string a, string b) {
if (a != b) cout << "\n=== Bad test === \n Expected: " << a << " \n Result: " << b << " \n";
}
int sum(int, int);
int main() {
if (true) {
testIt(4, sum(2, 2));
testIt(5, sum(2, 3));
testIt(0, sum(10, -10));
}
///////////////////////////////////////////
int a, b;
cin >> a >> b;
cout << sum(a, b) << endl;
return 0;
}
int sum(int a, int b) {
return a - b;
}
// Compiler: v.5.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment