#include #include #include #include "../fs/fs.h" int main(int argc, char **argv) { int sum=0; int i=0; char *buf=malloc(256); puts("\n*** fools calculator ***"); while(1) { printf("enter numer (or 'exit' to finish) %i: ",i+1); fgets(buf,255,stdin); if(buf[1]=='x')break; i++; sum+=atoi(buf); } if(i!=0) { puts("--------"); printf("sum = %i \n",sum); printf("avg = %i \n\n",sum/i); } return 0; }