-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread.txt
More file actions
356 lines (248 loc) · 14.2 KB
/
Copy pathread.txt
File metadata and controls
356 lines (248 loc) · 14.2 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
内含100例python实例,全为自己编写,在python3.5环境下调试通过
示例:
主入口:com.python100.example.main.Main.py
如若调试哪一个示例,只需在Main.py打开对应示例的注释即可。
1.题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少
实现类:com.python100.example.files.Example1
2.企业发放的奖金根据利润提成。
利润(I)低于或等于10万元时,奖金可提10%;
利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
20万到40万之间时,高于20万元的部分,可提成5%;
40万到60万之间时高于40万元的部分,可提成3%;
60万到100万之间时,高于60万元的部分,可提成1.5%,
高于100万元时,超过100万元的部分按1%提成,
从键盘输入当月利润I,求应发放奖金总数?
实现类: com.python100.example.files.Example2
3.一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
实现类: com.python100.example.files.Example3
4.输入某年某月某日,判断这一天是这一年的第几天?
实现类: com.python100.example.files.Example4
5.输入三个整数x,y,z,请把这三个数由小到大输出
实现类: com.python100.example.files.Example5
6.斐波那契数列:0、1、1、2、3、5、8、13、21、34...输出
实现类: com.python100.example.files.Example6
7.将一个列表的数据复制到另一个列表中
实现类: com.python100.example.files.Example7
8.输出 9*9 乘法口诀表
实现类: com.python100.example.files.Example8
9.暂停一秒输出。
实现类: com.python100.example.files.Example9
10.暂停一秒输出,并格式化当前时间
实现类: com.python100.example.files.Example10
11.古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,
小兔子长到第三个月后每个月又生一对兔子,
假如兔子都不死,问每个月的兔子总数为多少?
实现类: com.python100.example.files.Example11
12.判断101-200之间有多少个素数,并输出所有素数
实现类: com.python100.example.files.Example12
13.打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,
其各位数字立方和等于该数本身。
例如:153是一个"水仙花数",
因为153=1的三次方+5的三次方+3的三次方
实现类: com.python100.example.files.Example13
14.将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5
实现类: com.python100.example.files.Example14
15.利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示
实现类: com.python100.example.files.Example15
16.输出指定格式的日期
实现类: com.python100.example.files.Example16
17.输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
实现类: com.python100.example.files.Example17
18.求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。
例如2+22+222+2222+22222(此时共有5个数相加),
几个数相加由键盘控制。
实现类: com.python100.example.files.Example18
19.一个数如果恰好等于它的因子之和,这个数就称为"完数"。例如6=1+2+3.编程找出1000以内的所有完数。
实现类: com.python100.example.files.Example19
20.一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?
实现类: com.python100.example.files.Example20
21.猴子吃桃问题:猴子第一天摘下若干个桃子,
当即吃了一半,还不瘾,又多吃了一个第二天早
上又将剩下的桃子吃掉一半,又多吃了一个。
以后每天早上都吃了前一天剩下的一半零一个。
到第10天早上想再吃时,见只剩下一个桃子了。
求第一天共摘了多少
实现类: com.python100.example.files.Example21
22.两个乒乓球队进行比赛,各出三人。
甲队为a,b,c三人,乙队为x,y,z三人。
已抽签决定比赛名单。有人向队员打听
比赛的名单。a说他不和x比,c说他不
和x,z比,请编程序找出三队赛手的名单
实现类: com.python100.example.files.Example22
23.打印出如下图案(菱形):
*
***
*****
*******
*****
***
*
实现类: com.python100.example.files.Example23
24.有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
实现类: com.python100.example.files.Example24
25.求1+2!+3!+...+20!的和
实现类: com.python100.example.files.Example25
26.利用递归方法求5!
实现类: com.python100.example.files.Example26
27.利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。
实现类: com.python100.example.files.Example27
28.5个人坐在一起,问第五个人多少岁?
他说比第4个人大2岁。问第4个人岁数,
他说比第3个人大2岁。问第三个人,
又说比第2人大两岁。问第2个人,
说比第一个人大两岁。最后问第一个人,
他说是10岁。请问第五个人多大?
实现类: com.python100.example.files.Example28
29.给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字
实现类: com.python100.example.files.Example29
30.一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
实现类: com.python100.example.files.Example30
31.输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母
实现类: com.python100.example.files.Example31
32.按相反的顺序输出列表的值
实现类: com.python100.example.files.Example32
33.按逗号分隔列表
实现类: com.python100.example.files.Example33
34.练习函数调用。
实现类: com.python100.example.files.Example34
35.文本颜色设置
实现类: com.python100.example.files.Example35
36.求100之内的素数。
实现类: com.python100.example.files.Example36
37.对10个数进行排序
实现类: com.python100.example.files.Example37
38.求一个3*3矩阵主对角线元素之和
实现类: com.python100.example.files.Example38
39.有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中
实现类: com.python100.example.files.Example39
40.将一个数组逆序输出
实现类: com.python100.example.files.Example40
41.模仿静态变量的用法
实现类: com.python100.example.files.Example41
42.学习使用auto定义变量的用法
实现类: com.python100.example.files.Example42
43.模仿静态变量(static)另一案例。
实现类: com.python100.example.files.Example43
44.两个 3 行 3 列的矩阵,实现其对应位置的数据相加,并返回一个新矩阵
实现类: com.python100.example.files.Example44
45.统计 1 到 100 之和
实现类: com.python100.example.files.Example45
46.求输入数字的平方,如果平方运算后小于 50 则退出
实现类: com.python100.example.files.Example46
47.两个变量值互换。
实现类: com.python100.example.files.Example47
48.数字比较
实现类: com.python100.example.files.Example48
49.使用lambda来创建匿名函数
实现类: com.python100.example.files.Example49
50.输出一个随机数。
实现类: com.python100.example.files.Example50
51.学习使用按位与 &
实现类: com.python100.example.files.Example51
52.学习使用按位或 |
实现类: com.python100.example.files.Example52
53.学习使用按位异或 ^
实现类: com.python100.example.files.Example53
54.取一个整数a从右端开始的4〜7位
实现类: com.python100.example.files.Example54
55.学习使用按位取反~
实现类: com.python100.example.files.Example55
56.画图,学用circle画圆形
实现类: com.python100.example.files.Example56
57.画图,学用line画直线
实现类: com.python100.example.files.Example57
58.画图,学用rectangle画方形
实现类: com.python100.example.files.Example58
59.画图,综合例子
实现类: com.python100.example.files.Example59
60.计算字符串长度
实现类: com.python100.example.files.Example60
61.打印出杨辉三角形(要求打印出10行如下图)
实现类: com.python100.example.files.Example61
62.查找字符串
实现类: com.python100.example.files.Example62
63.省略
64.省略
65.省略
66.输入3个数a,b,c,按大小顺序输出。
实现类: com.python100.example.files.Example66
67.输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组
实现类: com.python100.example.files.Example67
68.有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数
实现类: com.python100.example.files.Example68
69.有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。
实现类: com.python100.example.files.Example69
70.写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。
实现类: com.python100.example.files.Example70
71.编写input()和output()函数输入,输出5个学生的数据记录
实现类: com.python100.example.files.Example72
72.创建一个链表
实现类: com.python100.example.files.Example73
73.反向输出一个链表
实现类: com.python100.example.files.Example74
74.列表排序及连接
实现类: com.python100.example.files.Example75
75.放松一下,算一道简单的题目
实现类: com.python100.example.files.Example76
76.编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n
实现类: com.python100.example.files.Example77
77.循环输出列表
实现类: com.python100.example.files.Example77
78.找到年龄最大的人,并输出。请找出程序中有什么问题。
实现类: com.python100.example.files.Example78
79.字符串排序
实现类: com.python100.example.files.Example79
80.海滩上有一堆桃子,五只猴子来分。
第一只猴子把这堆桃子平均分为五份,
多了一个,这只猴子把多的一个扔入海中,
拿走了一份。第二只猴子把剩下的桃子又平均
分成五份,又多了一个,它同样把多的一个扔入
海中,拿走了一份,第三、第四、第五只猴子都
是这样做的,问海滩上原来最少有多少个桃子?
实现类: com.python100.example.files.Example80
81.809*??=800*??+9*?? 其中??代表的两位数,
809*??为四位数,8*??的结果为两位数,9*??的
结果为3位数。求??代表的两位数,及809*??后的结果。
实现类: com.python100.example.files.Example81
82.八进制转换为十进制
实现类: com.python100.example.files.Example82
83.求0—7所能组成的奇数个数
实现类: com.python100.example.files.Example83
84.连接字符串。
实现类: com.python100.example.files.Example84
85.输入一个奇数,然后判断最少几个 9 除于该数的结果为整数
实现类: com.python100.example.files.Example85
86.两个字符串连接程序
实现类: com.python100.example.files.Example86
87.回答结果(结构体变量传递)
实现类: com.python100.example.files.Example87
88.读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*
实现类: com.python100.example.files.Example88
89.某个公司采用公用电话传递数据,数据
是四位的整数,在传递过程中是加密的,加
密规则如下:每位数字都加上5,然后用和除
以10的余数代替该数字,再将第一位和第四
位交换,第二位和第三位交换。
实现类: com.python100.example.files.Example89
90.列表使用实例
实现类: com.python100.example.files.Example90
91.时间函数举例1
实现类: com.python100.example.files.Example91
92.时间函数举例2
实现类: com.python100.example.files.Example92
93.时间函数举例3
实现类: com.python100.example.files.Example93
94.时间函数举例4,一个猜数游戏,判断一个人反应快慢
实现类: com.python100.example.files.Example94
95.字符串日期转换为易读的日期格式
实现类: com.python100.example.files.Example95
96.计算字符串中子串出现的次数
实现类: com.python100.example.files.Example96
97.从键盘输入一些字符,逐个把它们写到磁盘文件上,直到输入一个 # 为止
实现类: com.python100.example.files.Example97
98.从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存
实现类: com.python100.example.files.Example98
99.有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中
实现类: com.python100.example.files.Example99
100.列表转换为字典
实现类: com.python100.example.files.Example100