diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2490a4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +/calc diff --git a/README.md b/README.md new file mode 100644 index 0000000..68b2d37 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Simple Calculator + +This is a buggy application that will be used for Lab5 of 'Introduction to Open Source Software Development.' + + - Fork the project. + - Create a topic branch from master. + - The branch name must be your student id. (e.g. 201624000) + - Make some commits to improve the project. + - Fix the well-knwon bugs. + - Remove object and binary files. + - Add .gitignore file + - Push this branch to your GitHub project. + - Open a Pull Request on GitHub. + - The Pull Request must be submitted to master branch of Classroom-IOSSD/SimpleCalculator! + - Capture the Pull Request and upload it to PLMS. + diff --git a/calc.c b/calc.c index 85f1466..b03877f 100644 --- a/calc.c +++ b/calc.c @@ -5,28 +5,29 @@ int main(){ FILE *fp = NULL; int operand1, operand2; char operator = ' '; - int result, line = 0; + float result, line = 0; fp = fopen("read.txt","r"); if(fp!=NULL){ - fscanf(fp, "%d", &line); + fscanf(fp, "%f", &line); for(int i=0; i