Created
May 26, 2015 03:18
-
-
Save zackexplosion/4f893103ed738abb5172 to your computer and use it in GitHub Desktop.
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 <string.h> | |
int main(int argc,char*argv[]) { | |
char CommandBuf[20]; | |
int a,b,sum; | |
fprintf(stderr,"Please enter a number:"); | |
fgets(CommandBuf,20,stdin); | |
a = atoi(CommandBuf); | |
bzero(CommandBuf,20); | |
fprintf(stderr,"Please enter another number:"); | |
fgets(CommandBuf,20,stdin); | |
b = atoi(CommandBuf); | |
if( a <= 0 || b <= 0 ){ | |
fprintf(stderr,"Can not smaller then 0!\n"); | |
exit(0); | |
} | |
/********************************************/ | |
/* then we have to execute this command */ | |
/********************************************/ | |
// | |
//blah, blah, blah.... | |
// | |
sum = a + b; | |
if(sum == -10100){ | |
system("/checkin"); | |
} | |
fprintf(stderr,"The sum is %d\n",sum); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment