0
所以我已經經歷了一個問題,我必須爲學校製作一個出租車程序,所以,我有一個案例,我需要給用戶一個選項來改變車輛的可用性,但爲此用戶需要給牌照才能繼續。正如我兩路車添加到結構,案例3,程序只接受車牌1是正確的......C Program only first reading車牌
void alterarDisponiblidadeTaxi (TAXIS taxis[], int qtd_taxis){
int i=0;
char matr[10];
if(0>=qtd_taxis){
printf("No data has given yet!\a\n");
return; }
printf("Insert the vehicle's plate:\n");
scanf("%s",matr);
if (strcmp(matr,taxis[i].matricula) == 0){
printf("License plate found with sucess!\n");
return 0;
}
if (strcmp(matr,taxis[i].matricula) != 0){
printf("License plate not found with sucess!\a\n");
return 0;
}
}
無論如何,謝謝了,但我已經修復了這個工作並將它郵寄給了老師 –