码迷,mamicode.com
首页 >  
搜索关键字:for while    ( 28479个结果
c .16.链接,比较代码讲解,分治策略与递归
1.链接代码 char* my_strcat(char* dist, const char* src) { if (dist == nullptr || src == nullptr) { return dist; } char* cp = dist; while (*cp != '\0') { + ...
分类:其他好文   时间:2021-04-05 11:42:36    阅读次数:0
Google Colab报错:SyntaxError: unexpected EOF while parsing
google colab报错: SyntaxError: unexpected EOF while parsing 搜了之后发现: 出现这种错误的原因肯定是你的语法格式不正确了, 多半是少了一个括号, 再好好检查 一下吧!!! 确实,检查代码后发现少了一个括号... 参考:Python错误Synta ...
分类:其他好文   时间:2021-04-02 13:16:59    阅读次数:0
实验二
#include <stdio.h> int main(){ int n,sum,x,y; sum=1; x=1; y=2; scanf("%d",&n); do { sum +=y; y=y*2; x++; }while(x<=n); printf("n=%d时,sum=%d\n",n,sum); ...
分类:其他好文   时间:2021-04-02 13:12:27    阅读次数:0
数组判断全零的一些代码研究
最精简版本 int check_data(int *array, int n) { while(n--) if (*array++ != 0x00) return 0; return 1; } 返回1 array数组全零,否则正常非全零。 int check_data(int *array) { w ...
分类:编程语言   时间:2021-04-01 13:15:24    阅读次数:0
java byte[]与十六进制字符串相互转换
###案例1 java byte[]与十六进制字符串相互转换 import java.util.Arrays; public class ccc { public static void main(String[] args) { int[] array ={-6, 1, 18, 114, 54, ...
分类:编程语言   时间:2021-04-01 12:57:31    阅读次数:0
非递归 前序/中序/后序 遍历二叉树
非递归前序遍历二叉树 1 void preTraverse(const BiTree &T){ 2 //initialStack(stack) 3 BiTree stack[MAX]; 4 int top=-1; 5 BiTree p=T; 6 //while(!stackEmpty(stack)| ...
分类:其他好文   时间:2021-03-31 12:27:44    阅读次数:0
C# While 超时设置
DateTime dt_now = DateTime.Now;//获取当前时间 while (dt_now.AddMinutes(1) > DateTime.Now) { //Todo:执行自己的操作 await Task.Delay(1000);//延迟1s } View Code 相对比较优雅一 ...
分类:Windows程序   时间:2021-03-31 11:49:06    阅读次数:0
搞懂二分查找
class Solution { public static void main(String[] args) { int[] arr = new int[]{0, 1, 2, 2, 2, 3, 4, 5}; //int index = binarySearch(arr, 2); //int ind ...
分类:其他好文   时间:2021-03-31 11:46:55    阅读次数:0
python操作hdfs
import contextlib import pyhdfs class HdfsUtil(object): def __init__(self, hosts='namenode1:9870,namenode2:9870', user_name='hdfs'): self.hosts = host ...
分类:编程语言   时间:2021-03-30 13:29:22    阅读次数:0
二分图匹配
//二分图匹配#include<cstdio>#include<cstring>using namespace std;const int N = 1005;int n,m,k; //a方n人 b方m人 k对关系 int u,v; int g[N][N]; //表示a,b之间有关系,赋值为0/1. ...
分类:其他好文   时间:2021-03-30 12:52:43    阅读次数:0
28479条   上一页 1 ... 22 23 24 25 26 ... 2848 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!