进出口控制代码,使用C语言编写:<br><br>```c<br>#include <stdio.h><br><br>int main()<br>{<br> int in = 0, out = 0;<br> int option;<br><br> while(1)<br> {<br> printf("Enter 1 for entrance, 2 for exit, or 0 to quit: ");<br> scanf("%d", &option);<br><br> if(option == 0)<br> {<br> printf("Program terminated.\n");<br> break;<br> }<br> else if(option == 1)<br> {<br> in++;<br> printf("Entrance successful. Current number of people inside: %d\n", in);<br> }<br> else if(option == 2)<br> {<br> if(in <= out)<br> {<br> printf("Entry denied. No one inside to leave.