Created
March 18, 2012 10:35
-
-
Save bobobo1618/2070451 to your computer and use it in GitHub Desktop.
BThing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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