2017年7月28日
摘要: 考拉兹猜想是1927年提出的猜想,至今仍然未解。考拉兹猜想的内容是:对于每一个正整数,如果他是奇数,则对它乘3再加1,如果它是偶数,则对他除2,。这样循环,最终结果都能得到1 n=int (raw_input()) while n!=1: if n%2==0: n/=2 else: n=3*n+1 阅读全文
posted @ 2017-07-28 13:48 乾元东 阅读(918) 评论(0) 推荐(0) 编辑
摘要: import matha = float (raw_input())b = float (raw_input())c = float (raw_input())tt = (a**2+b**2-c**2)/(2*a*b)print '%.1f' % (180/math.pi * math.acos(t 阅读全文
posted @ 2017-07-28 11:24 乾元东 阅读(4222) 评论(0) 推荐(0) 编辑
摘要: s = int (raw_input())if s/60==0: print '0' , '0' , selif s/60/60==0: print '0' , s/60 , s%60else: a=s/60/60 print a , (s-a*60*60)/60 , (s-a*60*60)%60 阅读全文
posted @ 2017-07-28 11:23 乾元东 阅读(789) 评论(0) 推荐(0) 编辑
摘要: 乱码原因:源码文件的编码格式为utf-8,但是window的本地默认编码是gbk,所以在控制台直接打印utf-8的字符串当然是乱码了! 解决方法:1、print mystr.decode('utf-8').encode('gbk')2、比较通用的方法: 复制代码代码如下: import systyp 阅读全文
posted @ 2017-07-28 11:20 乾元东 阅读(260) 评论(0) 推荐(0) 编辑
摘要: import mathwhile True: a = float (raw_input('input a:')) b = float (raw_input('input b:')) c = float (raw_input('input c:')) if a!=0: delta=b**2-4*a*c 阅读全文
posted @ 2017-07-28 11:19 乾元东 阅读(173) 评论(0) 推荐(0) 编辑
  2017年7月8日
摘要: java里常用的控制台输出语句有System.out.println和System.out.print 一:两者之间的区别如下: 1. 参数有区别: System.out.println() 可以不写参数 System.out.print(参数) 参数不能为空.必须有 2.效果有区别 println 阅读全文
posted @ 2017-07-08 14:32 乾元东 阅读(2898) 评论(0) 推荐(1) 编辑
  2017年5月4日
摘要: 在teaching数据库中创建一个名称为V_final的视图,包含学生学号、姓名、课程号、课程名和期末成绩,按学号升序排序,相同学号的记录按课程号升序排序。 CREATE VIEW V_final AS SELECT TOP(100) PERCENT student.studentno,studen 阅读全文
posted @ 2017-05-04 17:06 乾元东 阅读(276) 评论(0) 推荐(0) 编辑