码迷,mamicode.com
首页 >  
搜索关键字:python return    ( 192001个结果
c语言求输入的任一整数的各位数之和
源码: # include<stdio.h> int main(void){int a,i=0,sum=0;scanf("%d",&a);if(a<0) a=-a;//求负整数的while(a){sum+=(a%10);//sum存各位数之和a/=10;}printf("各位数字之和为:%d\n", ...
分类:编程语言   时间:2021-05-25 18:29:36    阅读次数:0
Python 树/搜索类算法
BFS: #1.设置队列 from queue import Queue q = Queue() #2.设置closed表 closed = set()/[] #3.开始循环 while not q.empty(): #取出 a = q.get() #判断 if a not in cloesd : ...
分类:编程语言   时间:2021-05-25 18:19:31    阅读次数:0
python之1-100之间的总和,奇数和,偶数和
一、总和 i = 1 sum = 0 while i <= 100: sum += i i += 1 print(sum) 二、奇数和 i = 1 sum = 0 while i <= 100: if i % 2 != 0: sum += i i += 1 print(sum) 三、偶数和 i = ...
分类:编程语言   时间:2021-05-25 18:19:09    阅读次数:0
#define 连接字符串
define连接字符串 #define conn(x,y) x##y,连接x与y #define toString(x) #x,将x变成字符串 #include <stdio.h> #define conn(x,y) x##y #define toChar(x) #x int main(void) ...
分类:其他好文   时间:2021-05-25 18:17:24    阅读次数:0
python输出所有三位数的回文数
for i in range(100, 1000): if str(i) == str(i)[::-1]: print(i) # 输出结果 101 111 121 131 141 151 161 171 181 191 202 212 222 232 242 252 262 272 282 292 ...
分类:编程语言   时间:2021-05-25 18:16:06    阅读次数:0
Javascript 浮点数
在复习归并排序的时候,使用到了递归,我一直以为是递归函数没写对,导致了Maximum call stack size exceeded 栈溢出,但是其实是JavaScript浮点数的自动转换的问题! function sort(arry,left,right){ if(left right){ re ...
分类:编程语言   时间:2021-05-25 17:48:06    阅读次数:0
JavaFx TableView 文本换行
TableView 的TableColumn有文本换行的需求。 方法如下: @FXML private TableColumn nameCol; nameCol.setCellValueFactory(new PropertyValueFactory<>("name")); //姓名 初始化name ...
分类:编程语言   时间:2021-05-25 17:45:25    阅读次数:0
O(logn)最长上升子序列并输出
O(logn)最长上升子序列并输出 +++ pre数组记录转移。 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1e6 ...
分类:其他好文   时间:2021-05-25 17:36:48    阅读次数:0
【Python函数与模块学习记录3】标准模块与第三方模块
1、OS模块 函数/变量 描述 os.environ 系统的环境变量 os.system(command) 在子shell中执行操作系统命令, 注意使用双引号,没有加入系统环境变量的应用,要使用全路径,否则直接使用可执行程序如pycharm64.exe os.sep 路径中使用的分隔符 os.pat ...
分类:编程语言   时间:2021-05-24 17:23:30    阅读次数:0
【Python函数与模块学习记录4】虚拟环境
1、虚拟环境-virtualenv 第一步:安装虚拟环境:pip instal virtualenv 第二步:新建一个目录来保存虚拟环境,相当于虚拟了三台电脑 cd / 进入根目录, mkdir envs 创建新目录,cd envs进入,显示:C:\envs> #这样就进入了虚拟环境的根目录。 现在 ...
分类:编程语言   时间:2021-05-24 17:22:54    阅读次数:0
192001条   上一页 1 ... 70 71 72 73 74 ... 19201 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!