摘要: #计算人体体脂率 #输入部分 #身高 personHeight = input("请输入你的身高(m):") personHeight = float(personHeight) #体重 personWeight = input("请输入你的体重(Kg):") personWeight = float(personWeight) #年龄 personAge = input("请输入你的年龄... 阅读全文
posted @ 2018-02-13 23:03 delphiclub 阅读(1136) 评论(0) 推荐(0) 编辑
摘要: # _*_ coding:utf-8 _*_ #在2.*版本和3.*版本上是有区别的 # content = raw_input("请输入内容:") # print(type(content)) #str # print(content) content = input("请输入内容:") print(type(content)) #python2(int),python3(str) pri... 阅读全文
posted @ 2018-02-12 22:26 delphiclub 阅读(137) 评论(0) 推荐(0) 编辑
摘要: # 一。算术运算符(+,-,*,**, /, //, %) # 加法运算符+ print(1 + 2) # 字符串相连 print("1"+"2") # 重载 print([1,2] + [3,4]) # 幂运算** # 2的10次方 print(2 ** 10) # 整除运算 // print(5 // 2) # 2 print(5.2 // 2) # 2.0 #... 阅读全文
posted @ 2018-02-12 15:28 delphiclub 阅读(951) 评论(0) 推荐(0) 编辑
摘要: 一.python 变量赋值方式有三种; 1.直接赋值:age = 28 2.多个变量赋值 age, sex = 28, 1 #每个变量都必须要有个对应的值 3.特殊形式的赋值(链式赋值) a = b = 28 注意,变量使用之前必须赋值,这点和C++不同,因为python 变量前面没有类型修饰符,也 阅读全文
posted @ 2018-02-12 10:29 delphiclub 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Python 注释分为三种: 1.单行注释:# 2.多行注释:前后3个单引号,或者三个双引号; 如:''' 多行注释 ''', """或者 多行注释 '""" 3.特殊注释: 如在linux 下面,在文件最前面加 #!/usr/bin/python ,代表 执行这个文件的时候,需要用这个程序来运行; 阅读全文
posted @ 2018-02-11 23:13 delphiclub 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 头文件widget.h widget.cpp 阅读全文
posted @ 2016-05-25 08:06 delphiclub 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 方法一: 方法二:免注册方式 阅读全文
posted @ 2016-04-29 11:44 delphiclub 阅读(2214) 评论(0) 推荐(0) 编辑
摘要: 一,在VS里面 新建项目->Visual C++ -> win32 控制台应用程序 -> 填写项目名称->下一步选择 dll ; 二,自动生成的文件如图: 以项目名称生成的Mydll.cpp,文件,我们可以在Mydll.cpp里面添加自己的函数和类;如: 也可以新建个cpp文件,在里面添加如上的代码 阅读全文
posted @ 2016-04-28 19:47 delphiclub 阅读(1322) 评论(0) 推荐(0) 编辑
摘要: 一。malloc/free的方式 二。C++中,用new/delete 操作符取代malloc/free 申请类的内存只用new/delete来做,new 的时候会自动调用相对应的类的构造函数,new对象数组的时候,必须要保证类中有默认的构造函数 阅读全文
posted @ 2016-04-22 14:00 delphiclub 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 当类中有类时,要知道构造函数的顺序,先构造成员的构造函数,在构造自己,析构的时候恰好相反; 1.构造函数的初始化类的成员2种方式如: 阅读全文
posted @ 2016-04-22 13:26 delphiclub 阅读(206) 评论(0) 推荐(0) 编辑