#include <stdlib.h>
#include <string.h>
int main(void){
double sum=0;
int ii=0;
char buf[256], token[100]; // I am making this "finite length". You need to know how long the line is that you allow...
printf("Enter the numbers to average on a single line, separated by space, then press <ENTER>\n");
gets(buf, 255, stdin);
token = strtok(buf, " ");
while(token != NULL) {
sum += atof(token);
ii++;
token = strtok("", " "); // get next number
}
printf("AVERAGE: ***** %lf\ *****", sum / (double)ii);
return 0;
}
このエラーが発生します-9行目:stdin undeclared & stdio.hヘッダーファイルを追加するとエラーが発生します-11行目:左辺値が必要です
誰でも修正できますか?