You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# include <stdio.h>
# include <string.h>
int main ( )
{
printf ( " 机房机位预定系统 \n " ) ;
printf ( " 菜单 \n " ) ;
int u = 5 , time , number , telephonenumber ;
printf ( " <请输入功能前的数字来选择你想要选择的服务> \n " ) ;
printf ( " ********************************************************** \n " ) ;
printf ( " * 1.查询某时间段机位状态 * \n " ) ;
printf ( " * 2.预定空机位 * \n " ) ;
printf ( " * 3.取消预定 * \n " ) ;
printf ( " * 4.查询等待结果 * \n " ) ;
printf ( " * 5.退出 * \n " ) ;
printf ( " ********************************************************** \n " ) ;
printf ( " 请输入你想要选择的服务: " ) ;
scanf ( " %d " , & u ) ;
if ( u = = 1 )
{
printf ( " 请输入( 8-20) 范围内的时间: " ) ;
scanf ( " %d " , & time ) ;
if ( time < 8 | | time > 20 )
{
printf ( " \t 时间输入错误! \n " ) ;
printf ( " 输入在( 8-20)范围内的时间: " ) ;
scanf ( " %d " , & time ) ;
}
printf ( " 这是在该时间段未被使用或预约的电脑机号: " ) ;
}
if ( u = = 2 )
{
printf ( " 请输入( 8-20) 范围内的时间: " ) ;
scanf ( " %d " , & time ) ;
if ( time < 8 | | time > 20 )
{
printf ( " \t 时间输入错误! \n " ) ;
printf ( " 输入在( 8-20)范围内的时间: " ) ;
scanf ( " %d " , & time ) ;
}
printf ( " 请输入你想要预定的机号,并且留下你的手机号码!: \n " ) ;
scanf ( " %s %s " , & number , & telephonenumber ) ;
printf ( " 再次输入你想要的预定的时间! \n " ) ;
scanf ( " %d " , & time ) ;
printf ( " 预定成功! \n " ) ;
}
if ( u = = 3 )
{
printf ( " 在( 8-20) 时间范围内输入你已经预定的时间: " ) ;
scanf ( " %d " , & time ) ;
if ( time < 8 | | time > 20 )
{
printf ( " 输入时间错误! \n " ) ;
printf ( " 在( 8-20) 时间范围内输入你已经预定的时间: \n " ) ;
scanf ( " %d " , & time ) ;
}
else
{
printf ( " 输入你预定的机号: \n " ) ;
scanf ( " %d " , & number ) ;
}
printf ( " \t 取消成功! \n " ) ;
}
if ( u = = 4 )
{
printf ( " 请输入你想要查询的时间段: \n " ) ;
scanf ( " %d " , & time ) ;
if ( time < 8 | | time > 20 )
{
printf ( " 输入时间错误 \n " ) ;
printf ( " 在( 8-20) 时间范围内输入你已经预定的时间: " ) ;
scanf ( " %d " , & time ) ;
}
}
if ( u = = 5 )
printf ( " 已成功退出! \n " ) ;
}