码迷,mamicode.com
首页 >  
搜索关键字:scala for if match while    ( 37974个结果
pipioj 1175: 货运费用(最短路)
1 #define IO std::ios::sync_with_stdio(0) 2 #include <bits/stdc++.h> 3 using namespace std; 4 #define mk make_pair 5 #define pb push_back 6 const int ...
分类:其他好文   时间:2021-01-06 11:49:40    阅读次数:0
1688. 比赛中的配对次数
题干 给你一个整数 n ,表示比赛中的队伍数。比赛遵循一种独特的赛制: 如果当前队伍数是 偶数 ,那么每支队伍都会与另一支队伍配对。总共进行 n / 2 场比赛,且产生 n / 2 支队伍进入下一轮。 如果当前队伍数为 奇数 ,那么将会随机轮空并晋级一支队伍,其余的队伍配对。总共进行 (n - 1) ...
分类:其他好文   时间:2021-01-05 11:41:42    阅读次数:0
练习:已知后序遍历和中序遍历,求层次遍历--C++实现
#include<iostream> #include<vector> using namespace std; vector<char>post,in; vector<char>level(100000,-1); in N; void ergodic(int root,int start,int ...
分类:编程语言   时间:2021-01-05 11:40:19    阅读次数:0
练习:求字符串中最小和--python实现
""" 输入字符串,判断只包含数字、a-z、A-Z、+-的数字串,进行+-,算出最小和 """ import re def sum_s(s): sum = 0 if re.match('^[0-9a-zA-Z+-]+$',s):#判断只包含数字、a-z、A-Z、+-的数字串 list1 = re.f ...
分类:编程语言   时间:2021-01-05 11:35:21    阅读次数:0
python中while循环
1、 >>> a = "" >>> while a != "quit": a = input("please input a str or 'quit' to leave: ") print(a) please input a str or 'quit' to leave: 100 100 plea ...
分类:编程语言   时间:2021-01-05 11:31:35    阅读次数:0
yield函数生成器
在python中,有yield的函数是生成器函数 def gen(para): while True: yield para print(next(gen(8))) print(next(gen(88))) print(next(gen(888))) print(" ") def gen2(): l ...
分类:其他好文   时间:2021-01-05 11:24:19    阅读次数:0
【leetcode】306. 累加数
bool isAdditiveNumber(char * num){ int i, j, k, len=strlen(num), pst1=0, pst2=0, bit=0, third; char* tmp1=(char*)calloc(22,sizeof(char)); char* tmp2=( ...
分类:其他好文   时间:2021-01-05 11:20:52    阅读次数:0
快速排序
#include<bits/stdc++.h> using namespace std; int n; void mysort(int a[],int l,int r)//自己写的快排 { int mid=a[(l+r)/2];//找中间的数进行2分 int i=l,j=r; do{ while(a ...
分类:编程语言   时间:2021-01-05 10:39:05    阅读次数:0
lombok标签之@Data @AllArgsConstructor @@NoArgsConstructor -如何去除get,set方法。@Data注解和如何使用,lombok
在代码中我们可以只加上标签@Data 而不用get,set方法; val : 和 scala 中 val 同名, 可以在运行时确定类型; @NonNull : 注解在参数上, 如果该类参数为 null , 就会报出异常, throw new NullPointException(参数名) @Clea ...
分类:其他好文   时间:2021-01-04 11:15:37    阅读次数:0
The current path, page/, didn't match any of these
最近在学习python,按照网上的步骤进行操作 url.py的代码 但是一直报如下的错。 Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/page/ Using the URLconf defin ...
分类:其他好文   时间:2021-01-04 11:14:18    阅读次数:0
37974条   上一页 1 ... 49 50 51 52 53 ... 3798 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!