我收到错误编译错误:之前预期的表达“{”令牌
error: expected expression before ‘{’ token
试图编译下面的代码时:
#include <stdio.h>
int main()
{
srand (time(NULL));
int Seat[10] = {0,0,0,0,0,0,0,0,0,0};
int x = rand()%5;
int y = rand()%10;
int i, j;
do {
printf("What class would you like to sit in, first (1) or economy (2)?");
scanf("%d", &j);
if(j == 1){
Seat[x] = 1;
printf("your seat number is %d and it is type %d\n", x, j);
}
else{
Seat[y] = 1;
printf("your seat number is %d and is is type %d\n", y, j);
}
}while(Seat[10] != {1,1,1,1,1,1,1,1,1,1});
}
背景:该计划旨在为航空公司座位预订系统。
这听起来像功课。是吗? – unwind 2012-04-11 12:12:50
它是每周实验室的一部分,我只是无法boathered描述的问题ahaha – user1304516 2012-04-11 12:15:42
我不认为这是非常优雅的期待别人做更多的工作,因为你*不能boathered * – Yuri 2012-04-11 12:17:59