Skip to content

Instantly share code, notes, and snippets.

@bobobo1618
Created March 18, 2012 10:35
Show Gist options
  • Save bobobo1618/2070451 to your computer and use it in GitHub Desktop.
Save bobobo1618/2070451 to your computer and use it in GitHub Desktop.
BThing
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
switch(argc) {
case 1:
cout << "s3382003, s3382003@student.rmit.edu.au, Belinda Hester" << endl;
return EXIT_SUCCESS;
case 3:
int a,b;
a = atoi(argv[1]);
b = atoi(argv[2]);
if(a <= 32000 && a >= -32000 && b <= 32000 && b >= -32000 && a && b){
cout << a+b << endl;
} else {
cout << "R" << endl;
}
return EXIT_SUCCESS;
default:
cout << "p" << endl;
return EXIT_FAILURE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment