cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
package cn.ksource.test;
 
import java.util.Scanner;
 
import cn.ksource.core.util.ConvertUtil;
import cn.ksource.core.util.StringUtil;
 
public class Zh {
 
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        System.out.println("****六一儿童节来了,欢迎各位小朋友和爸爸妈妈!");
        cin.nextLine();
        System.out.println("****首先自我介绍一下,我叫小云雀,是我们云雀家族的宝贝!");
        cin.nextLine();
        System.out.println("今天我想和你玩一个小游戏,你准备好了吗?");
        System.out.println("1:我准备好了    2:还没准备好");
        String ready = cin.nextLine();
        
        while (ready.equals("2")) {
            System.out.println("****没事,慢慢来,我等你");
            ready = cin.nextLine();
            continue;
        }
        
        System.out.println("****请输入你的名字:");
        String name = cin.nextLine();
        
        System.out.println("****首先我很欢迎你,"+name+"小朋友");
        
        cin.nextLine();
        System.out.println("****今天带你来的是爸爸还是妈妈呢?");
        System.out.println("1:爸爸   2:妈妈   3:爸爸和妈妈 ");
        String fm = cin.nextLine();
        
        while (!fm.equals("2")&&!fm.equals("1")&&!fm.equals("3")) {
            System.out.println("****哦,不好意思,我没有考虑到其他情况!");
            fm = cin.nextLine();
            continue;
        }
        
        
        String fmName = new String();
        if(fm.equals("1")) {
            fmName = "爸爸";
        } else if(fm.equals("2")){
            fmName = "妈妈";
        } else {
            fmName = "爸爸和妈妈";
        }
        
        System.out.println("****我们大家欢迎"+name+"小朋友的"+fmName);
        
        cin.nextLine();
        
        
        System.out.println("****接下来我要让你做一件事情,你愿意吗?");
        System.out.println("1:愿意  2:不愿意");
        
        String yy = cin.nextLine();
        while (yy.equals("2")) {
            System.out.println("****我们这个事情很好玩的哦,再给你一些考虑时间吧");
            yy = cin.nextLine();
            continue;
        }
        
        System.out.println("****请随便输入一个数字 ");
        String random = cin.nextLine();
        String value = getRandomValue(random, fmName);
        while (value.equals("abc")) {
            System.out.println("****你没有选择1到5之间的数哦,请重新选择:");
            random = cin.nextLine();
            value = getRandomValue(random, fmName);
            continue;
        }
        
        System.out.println("****"+value);
        
        
        cin.nextLine();
        
        System.out.println("****小朋友,事情做完了吗?");
        
        System.out.println("1:做完了   2:还没做");
        
        String sq = cin.nextLine();
        if(sq.equals("1")) {
            System.out.println("****"+name+"小朋友,你做的真棒!我们以后就是好朋友了");
        } else {
            System.out.println("****哦,那"+name+"小朋友,赶快行动起来吧!加油!");
        }
        
        cin.nextLine();
        
        System.out.println("****最后祝大家,六一儿童节快乐");
        
        
        
        System.out.println(callBack("*"));
 
 
        }
 
 
 
        public static String callBack(String input){
 
        int[] array = {0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 4, 5, 2, 3, 4, 1, 0, 1,
 
                    0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
        StringBuffer sb = new StringBuffer();
 
        for (int i = 0; i < array.length; i++) {
 
        if(i % 7 == 0)
 
        sb.append("  \n");
 
        if(array[i] == 0)
 
        sb.append("   ");
 
        else if(array[i] == 4)
 
        sb.append("  ");
 
        else if(array[i] == 5)
 
        sb.append(" 儿童 ");
 
        else if(array[i] == 2)
 
        sb.append("节 ");
 
        else if(array[i] == 3)
 
        sb.append("快乐");
 
        else
 
        sb.append("  "+input);
 
        }
 
        return sb.toString();
 
 
        
        
    }
    
    
    public static String getRandomValue(String r,String fmName) {
        String value = new String();
        if(StringUtil.notEmpty(r)) {
            r = r.trim();
        }
        
        java.util.Random abc = new java.util.Random();// 定义随机类
        int result = abc.nextInt(5);// 返回[0,10)集合中的整数,注意不包括10return result+1;   
        result = result+1;
        
        String random = ConvertUtil.obj2StrBlank(result);
        
        if(random.equals("1")) {
            value = "我要让你做的事情是:去抱一下你的"+fmName;
        } else if(random.equals("2")) {
            value = "我要让你做的事情是:去亲一下你的"+fmName;
        } else if (random.equals("3")) {
            value = "我要让你做的事情是:告诉"+fmName+"你想对他们说的话";
        } else if (random.equals("4")) {
            value = "我要让你做的事情是:对"+fmName+"说我爱你";
        } else if (random.equals("5")) {
            value = "让我们张茵姐姐发小礼物";
        } else {
            value = "abc";
        }
        return value;
    }
}