- 以下代码由CSDN论坛复制
- //规则
- struct rule{
- char x;
- int y;
- }rul[6]={{'E',3},{'E',1},{'T',3},{'T',1},{'F',3},{'F',1}};
- class Rule{
- public char x;
- public int y;
- Rule(char x,int y){
- this.x=x;
- this.y=y;
- }
- }
- class Rual{
- public static Rule ru[]=new Rule[6];
- public static void main(String[] args) {
- ru[0]=new Rule('E',3);
- ru[1]=new Rule('E',1);
- ru[2]=new Rule('T',3);
- ru[3]=new Rule('T',1);
- ru[4]=new Rule('F',3);
- ru[5]=new Rule('F',1);
- }
- }