为什么13行出错是这样
  • 板块学术版
  • 楼主wbstc12138
  • 当前回复5
  • 已保存回复5
  • 发布时间2020/11/25 20:54
  • 上次更新2023/11/5 07:20:50
查看原帖
为什么13行出错是这样
417994
wbstc12138楼主2020/11/25 20:54

13行[Error] invalid types 'float [10000][float]' for array subscript

#include <stdio.h>
#include <math.h>
int main() {
	float a[10000];
	float b, c, d, e;
	d=0;
	for (b=2; b<1e7; b++) {
		e=0;
		for (c=2; c<sqrt(b); c++) {
			if (b/c==0) {
				a[d]=b, d++, e=1, break;
			}
			if (e==1) break;
		}
	}
	for (d=0; d<n; d++) printf("%f", a[d]);
	return 0;
}
2020/11/25 20:54
加载中...