用字符数组实现计算器(部分功能)编写
#include <stdio.h>#define MAXLINE 100
main()
{ double sum,atof(char[ ]);
char line[ MAXLINE ];
int getline (charline[ ],int max);
sum = 0;
while( getline (line, MAXLINE ) > 0)
printf("\t%g\n", sum += atof(line));
return 0;
}
[此贴子已经被作者于2005-6-1 17:21:58编辑过]