某些具体程序要求待未发送完的数据发送出去后再关闭socket,可通过设置让程序满足要求: struct linger { u_short l_onoff; u_short l_linger; }; struct linger m_sLinger; m_sLinger.l_onoff = 1; //在 ...
分类:
其他好文 时间:
2020-08-02 12:49:38
阅读次数:
84
1.列表、元组和字符串的共同点 都可以通过索引得到每一个元素 默认索引值总是从0开始 可以通过分片的方法得到一个范围内的元素的集合 有很多共同的操作符(重复操作符、拼接操作符、成员关系操作符) 2.创建序列 >>> list('abcdefg') ['a', 'b', 'c', 'd', 'e', ...
分类:
其他好文 时间:
2020-08-01 21:20:30
阅读次数:
67
题目:找到年龄最大的人,并输出。请找出程序中有什么问题。 程序分析:无。 实例: 1 #include<stdio.h> 2 #include<stdlib.h> 3 struct man{ 4 char name[20]; 5 int age; 6 } 7 person[3]={"li",18," ...
分类:
其他好文 时间:
2020-08-01 21:15:42
阅读次数:
69
据传这类问题叫做有依赖性的背包问题:选某个物品的同时必须连带选其他物品 容易想到其实是决策发生了变化: 可以选啥都不选 可以只选主件 可以选主件+一个附件 可以选主件+两个附件 其他和01背包一样 struct Bag { int w; int val; Bag(int x = 0,int y = ...
分类:
其他好文 时间:
2020-07-30 22:20:53
阅读次数:
91
Python基础学习(29)基于TCP协议的文件传输 验证客户端合法性 socketserver 模块处理并发客户端请求 一、今日内容 基于 TCP 协议的文件传输 验证客户端合法性 socketserver 模块处理并发客户端请求 二、基于 TCP 协议的文件传输 基本功能实现 # server. ...
分类:
编程语言 时间:
2020-07-30 22:17:38
阅读次数:
88
节点的结构 struct Node { int value; struct Node* next; }; typedef struct Node Node; 基本功能和操作演示 #include <stdio.h> #include <stdlib.h> struct Node { int valu ...
分类:
编程语言 时间:
2020-07-30 22:10:51
阅读次数:
73
#include <bits/stdc++.h> #define MAXN 200005 using namespace std; int node,edge,ans=0,k=0; int fat[MAXN],siz[MAXN]; struct EDGE { int from,to,cost; } ...
分类:
编程语言 时间:
2020-07-30 01:20:30
阅读次数:
71
节点的数据结构 struct Node { int value; struct Node* next; }; typedef struct Node Node; 操作和演示 #include <stdlib.h> #include <stdio.h> // 建立一个节点 Node *createNo ...
分类:
编程语言 时间:
2020-07-30 01:18:43
阅读次数:
82
struct point{ double x, y; }; struct line{ double A, B, C;//Ax + By + C = 0; }; line PPL(point a, point b){// 两点确定直线的一般式 if(a.x == b.x) return line{1, ...
分类:
其他好文 时间:
2020-07-29 17:50:20
阅读次数:
62
##输出1到n以内所有的二进制回文数 #include <stdio.h> #define SIZE 50 typedef enum bool Bool; enum bool { false, true }; int main() { int n, i, j; Bool flag = false; ...
分类:
其他好文 时间:
2020-07-29 10:02:00
阅读次数:
84