我收到錯誤編譯錯誤:之前預期的表達「{」令牌
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