Skip to content

Instantly share code, notes, and snippets.

@zackexplosion
Created May 26, 2015 03:18
Show Gist options
  • Save zackexplosion/4f893103ed738abb5172 to your computer and use it in GitHub Desktop.
Save zackexplosion/4f893103ed738abb5172 to your computer and use it in GitHub Desktop.
#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