# 求1-2+3-4+5.....99的所有数的和(含等式)s = "" sum = 0start = 1 while start < 100: temp = start % 2 if temp == 1: if start == 1: s = str(start) else: s = s + "+ ...
分类:
编程语言 时间:
2020-05-10 11:03:41
阅读次数:
82
# 输出 1-100 的奇数 start = 1 while start <= 100: temp = start % 2 if temp == 1: print(start) else: pass start += 1 # 输出1-100 偶数 start = 1 while start <= 1 ...
分类:
编程语言 时间:
2020-05-10 10:43:47
阅读次数:
52
题目: 解答: class Solution { public: int convertInteger(int A, int B) { int res = 0; int temp = A ^ B; while (temp!=0) { int lowbit = temp & (-temp); res+ ...
分类:
其他好文 时间:
2020-05-10 01:30:03
阅读次数:
54
当在go里面使用map的时候 , 一般我们是先声明然后再make一下 , 然后赋值 还有一种方式是直接使用字面量初始化 m:=map[string]string{ "name":"taoshihan" } 这种方式就是直接使用字面量的方式 , 当与一些type定义的类型别名综合时 , 代码初看会觉得 ...
分类:
其他好文 时间:
2020-05-10 01:04:23
阅读次数:
73
1.原理: 第一个数与第二个数进行比较,如果满足条件位置不变,再把第二个数与第三个数进行比较.不满足条件则替换位置,再把第二个数与第三个数进行比较,以此类推,执行完为一个趟,趟数等于比较的个数减一. 2.实现: 1.创建测试类 package test; public class Test { pu ...
分类:
编程语言 时间:
2020-05-09 23:32:14
阅读次数:
70
题目: 解答: 1 class Solution { 2 public: 3 int reverse_string(string& s, int start, int end) 4 { 5 for (int i = start; i <= (start + end) / 2; i++) 6 { 7 ...
分类:
其他好文 时间:
2020-05-09 21:44:58
阅读次数:
67
打印n个数的全排列 (1)使用stl里的next_permutation() #include<iostream> #include<algorithm> using namespace std; int main(){ int data[4]={5,2,1,4}; sort(data,data+4 ...
分类:
其他好文 时间:
2020-05-09 20:54:57
阅读次数:
76
视图(View) 是Django的 MTV 架构模式的V部分, 主要负责处理用户请求和生成相应的响应内容 , 然后在页面或其他类型文档中显示。 也可以理解为视图是MVC架构里面的C部分(控制器),主要处理功能和业务上的逻辑。 构建网页内容 响应类型 在构建网页前,我们先了解响应类型,视图函数都是通过 ...
分类:
其他好文 时间:
2020-05-09 19:27:34
阅读次数:
58
思考: 大家可以思考一下下面sql语句写的有没有问题? select jg.id as goodsId,jm.name,... from jdy_merchant jm left outer join jdy_express_template jet on jet.id = jg.freight l ...
分类:
数据库 时间:
2020-05-09 18:59:43
阅读次数:
66
#主程序from flask import Flask from flask import request import subprocess import json htmltemp=""" <!DOCTYPE html> <html lang="zh-CN"> <head> <meta char ...
分类:
编程语言 时间:
2020-05-09 18:42:14
阅读次数:
59