📄 custominfo.java
字号:
public class customInfo{ //用一个3维数组(一维代表电影号,二维代表场次,三维代表100个座位是否被订购0空
//1表示已被定)的类变量来存放。
static int aa[][]=new int[5][100];;
public customInfo(){
for(int j=0;j<5;j++)
{
for(int k=0;k<100;k++)
{
aa[j][k]=0;
}
}
}
public static void setPoint(int a,int b){
for(int j=1;j<=100;j++)
{
if(aa[b-1][j-1]==0)
System.out.print(j+" ");
else
System.out.print(" ");
if(j%10==0)
System.out.println( );
} }
public static void setprint(int b,int c){
if(aa[b][c-1]==0){
System.out.println("恭喜!~定票成功!");
System.out.println("你预定的场次是:"+" "+b+" "+"座位号是"+c);
}
else
System.out.println("非常抱歉!~您的座位已被预定,欢迎预定同场次的其它座位!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -