linux:

tcpclient.cpp

 #include<iostream>
#include<unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netdb.h>
#include<arpa/inet.h>
#include<cstring>
#include<sstream> using namespace std; #define BUFSIZE 512 // #define SERVERIP "192.168.41.32"
// #define SERVERPORT 4140 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} void getarg(int argc,char* argv[],const char** SERVERIP,int* SERVERPORT)
{
for(int i=;i<argc;i++)
{
istringstream iss(argv[i]);
string str;
iss>>str;
if(str=="ip")
{
*SERVERIP=argv[i+];
}
else if(str=="port")
{
istringstream sts(argv[i+]);
string s_port;
sts>>s_port;
*SERVERPORT=stoi(s_port);
}
else
{ } }
} int main(int argc,char *argv[])
{
const char* SERVERIP="192.168.43.230";
int SERVERPORT=; getarg(argc,argv,&SERVERIP,&SERVERPORT); int sockfd;
struct sockaddr_in server_addr;
const char* sendbuf = (char*)"hello,this is client";
char recvbuf[BUFSIZE]; //create socket
if ((sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) <)//创建套接字
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
} memset(&server_addr,, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(SERVERPORT);
server_addr.sin_addr.s_addr = inet_addr(SERVERIP); if ((connect(sockfd, (struct sockaddr*) & server_addr, sizeof(struct sockaddr))) < )//连接远程对等实体
{
fprintf(stderr,"connect error %s\n",strerror(errno));
exit(-);
} if ((send(sockfd, sendbuf, strlen(sendbuf), )) != strlen(sendbuf))//发送数据
{
fprintf(stderr,"send error %s\n",strerror(errno));
exit(-);
} memset(recvbuf, '\0',sizeof(recvbuf));
while (true)
{
int num = recv(sockfd, recvbuf, sizeof(recvbuf), );//接受数据
if (num < )
{
fprintf(stderr,"recv error %s\n",strerror(errno));
exit(-);
}
else
{
cout << recvbuf << endl;
break;
}
} cout<<"exit..."<<endl; close(sockfd);//终止通信并释放套接字描述符 return ;
}

tcpserv.cpp

 #include<iostream>
#include<string.h>
#include <unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netdb.h>
#include<arpa/inet.h> #define BUFSIZE 512
#define PORT 4140
#define MAXLISTEN 128 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} int main()
{
int sockfd;//server fd
// int port;
int newfd;//connect fd
struct sockaddr_in server_addr;
struct sockaddr_in client_addr; char reqbuf[BUFSIZE]; /*create server socket*/
if((sockfd=socket(AF_INET,SOCK_STREAM,))<)//创建套接字
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
} /*ready for server addr*/
memset(&server_addr,,sizeof(server_addr));
server_addr.sin_family=AF_INET;
server_addr.sin_addr.s_addr=htonl(INADDR_ANY);
server_addr.sin_port=htons(PORT); /*bind socket addr*/
int tmp=bind(sockfd,(struct sockaddr*)&server_addr,sizeof(server_addr));//将ip和port绑定到套接字上
if(tmp<)
{
fprintf(stderr,"Bind error %s\n",strerror(errno));
exit(-);
} /*listen*/
if((listen(sockfd,MAXLISTEN))<)//将套接字设置为被动模式
{
fprintf(stderr,"Listen error %s\n",strerror(errno));
exit(-);
}
std::cout<<"waiting for client ..."<<std::endl; /*server main while*/
// while(true)
// {
socklen_t size;
size=sizeof(struct sockaddr_in); /*accept client & create new fd*/
if((newfd=accept(sockfd,(struct sockaddr*)&client_addr,&size))<)//接受传入连接请求
{
fprintf(stderr,"Accept error %s\n",strerror(errno));
exit(-);
}
std::cout<<"Server got connect from "<<inet_ntoa(client_addr.sin_addr)<<std::endl; /*recv data from client*/
if((recv(newfd,reqbuf,sizeof(reqbuf),))<)//获取数据
{
fprintf(stderr,"Recv error %s\n",strerror(errno));
exit(-);
}
std::cout<<reqbuf<<std::endl; /*send data to client*/
char *sendbuf=(char*)"hello,this is server.";
if((send(newfd,sendbuf,strlen(sendbuf),))!=strlen(sendbuf))//发送数据
{
fprintf(stderr,"Send error %s\n",strerror(errno));
exit(-);
} /*close new fd*/
close(newfd);//终止通信并释放套接字描述符
// } /*close server fd*/
close(sockfd);//释放套接字描述符 std::cout<<"exit"<<std::endl; return ;
}

udpclient.cpp

 #include<iostream>
#include <unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netdb.h>
#include<arpa/inet.h>
#include<cstring>
#include<sstream> using namespace std; #define BUFSIZE 512 // #define SERVERIP "192.168.2.169"
// #define SERVERPORT 4140 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} void getarg(int argc,char* argv[],const char** SERVERIP,int* SERVERPORT)
{
for(int i=;i<argc;i++)
{
istringstream iss(argv[i]);
string str;
iss>>str;
if(str=="ip")
{
*SERVERIP=argv[i+];
}
else if(str=="port")
{
istringstream sts(argv[i+]);
string s_port;
sts>>s_port;
*SERVERPORT=stoi(s_port);
}
else
{ } }
} int main(int argc,char* argv[])
{
const char* SERVERIP="192.168.41.32";
int SERVERPORT=; getarg(argc,argv,&SERVERIP,&SERVERPORT); int sockfd;
struct sockaddr_in server_addr;
struct sockaddr_in client_addr;
char* sendbuf = (char*)"hello,this is client";
char recvbuf[BUFSIZE]; //create socket
if ((sockfd = socket(AF_INET, SOCK_DGRAM,)) <)//创建套接字描述符
{
fprintf(stderr,"socket error %s\n",strerror(errno));
exit(-);
} memset(&server_addr, ,sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(SERVERPORT);
server_addr.sin_addr.s_addr = inet_addr(SERVERIP); // if ((connect(sockfd, (struct sockaddr*) & server_addr, sizeof(struct sockaddr))) < 0)
// {
// cout << "Connect Error::" << GetLastError() << endl;
// return -1;
// } if ((sendto(sockfd, sendbuf, strlen(sendbuf), ,(struct sockaddr*)&server_addr,sizeof(struct sockaddr_in))) != strlen(sendbuf))//发送数据
{
fprintf(stderr,"sendto error %s\n",strerror(errno));
exit(-);;
} memset(&client_addr,,sizeof(client_addr));
memset(recvbuf, '\0',sizeof(recvbuf));
while (true)
{
socklen_t len=sizeof(struct sockaddr_in);
int num = recvfrom(sockfd, recvbuf, sizeof(recvbuf), ,(struct sockaddr*)&client_addr,&len);//获取数据
if (num < )
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
}
else
{
cout << recvbuf << endl;
break;
}
} close(sockfd);//终止通信并释放套接字描述符 return ;
}

udpserv.cpp

 #include<iostream>
#include<string.h>
#include <unistd.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netdb.h>
#include<arpa/inet.h>
// #include<signal.h> #define BUFSIZE 512
#define PORT 4140
#define MAXLISTEN 128 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} int main()
{
int sockfd;//server fd
// int port;
int newfd;//connect fd
struct sockaddr_in server_addr;
struct sockaddr_in client_addr; char reqbuf[BUFSIZE]; /*create server socket*/
if((sockfd=socket(AF_INET,SOCK_DGRAM,))<)//创建套接字描述符
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
} /*ready for server addr*/
memset(&server_addr,,sizeof(server_addr));
server_addr.sin_family=AF_INET;
server_addr.sin_addr.s_addr=htonl(INADDR_ANY);
server_addr.sin_port=htons(PORT); /*bind socket addr*/
if((bind(sockfd,(struct sockaddr*)&server_addr,sizeof(server_addr)))<)//将ip和port绑定到套接字上
{
fprintf(stderr,"Bind error %s\n",strerror(errno));
exit(-);
} /*server main while*/
// while(true)
// {
socklen_t size;
size=sizeof(struct sockaddr_in);
memset(&client_addr,,sizeof(client_addr)); /*recv data from client*/
if((recvfrom(sockfd,reqbuf,sizeof(reqbuf),,(struct sockaddr*)&client_addr,&size))<)//获取数据
{
fprintf(stderr,"Recvfrom error %s\n",strerror(errno));
exit(-);
}
std::cout<<reqbuf<<std::endl; /*send data to client*/
char *sendbuf=(char*)"hello,this is server.";
if((sendto(sockfd,sendbuf,strlen(sendbuf),,(struct sockaddr*)&client_addr,size))!=strlen(sendbuf))//发送数据
{
fprintf(stderr,"Sendto error %s\n",strerror(errno));
exit(-);
} // } /*close server fd*/
close(sockfd);//终止通信并释放套接字描述符 std::cout<<"exit"<<std::endl; return ;
}

windows:

tcpclient.cpp

 #include<iostream>
#include<WinSock2.h>
#include<cstring>
#include<sstream> #pragma comment(lib, "ws2_32") using namespace std; // #define SERVERIP "192.168.41.32"
// #define SERVERPORT 4140 void getarg(int argc,char* argv[],const char** SERVERIP,int* SERVERPORT)
{
for(int i=;i<argc;i++)
{
istringstream iss(argv[i]);
string str;
iss>>str;
if(str=="ip")
{
*SERVERIP=argv[i+];
}
else if(str=="port")
{
istringstream sts(argv[i+]);
string s_port;
sts>>s_port;
*SERVERPORT=stoi(s_port);
}
else
{ } }
} int main(int argc,char *argv[])
{
const char* SERVERIP="192.168.41.32";
int SERVERPORT=; getarg(argc,argv,&SERVERIP,&SERVERPORT); SOCKET sockfd;
struct sockaddr_in server_addr;
WSADATA ws;
const char* sendbuf = (char*)"hello,this is client";
char recvbuf[MAX_PATH]; //init windows socket
if (WSAStartup(MAKEWORD(, ), &ws) != )
{
cout << "Init Windows Socket Failed::" << GetLastError() << endl;
return -;
} //create socket
if ((sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET)//创建套接字描述符
{
cout << "Create Socket Failed::" << GetLastError() << endl;
return -;
} ZeroMemory(&server_addr, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(SERVERPORT);
server_addr.sin_addr.S_un.S_addr = inet_addr(SERVERIP); if ((connect(sockfd, (struct sockaddr*) & server_addr, sizeof(struct sockaddr))) < )//连接远程对等实体
{
cout << "Connect Error::" << GetLastError() << endl;
return -;
} if ((send(sockfd, sendbuf, strlen(sendbuf), )) != strlen(sendbuf))//发送数据
{
cout << "Send Error::" << GetLastError() << endl;
return -;
} ZeroMemory(recvbuf, sizeof(recvbuf));
while (true)
{
int num = recv(sockfd, recvbuf, sizeof(recvbuf), );//获取数据
if (num < )
{
cout << "Recv Error::" << GetLastError() << endl;
return -;
}
else
{
cout << recvbuf << endl;
break;
}
} cout<<"exit..."<<endl; closesocket(sockfd);//终止通信并释放套接字
WSACleanup(); system("pause"); return ;
}

tcpserver.cpp

 #include<iostream>
#include<WinSock2.h>
// #include<cstring>
// #include<unistd.h> #pragma comment(lib, "ws2_32") using namespace std; #define BUFSIZE 512
#define PORT 4140
#define MAXLISTEN 128 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} int main()
{
SOCKET sockfd;//server fd
// int port;
SOCKET newfd;//connect fd
struct sockaddr_in server_addr;
struct sockaddr_in client_addr;
WSADATA ws; char reqbuf[BUFSIZE]; //init windows socket
if(WSAStartup(MAKEWORD(,),&ws)!=)
{
cout << "Init Windows Socket Failed::" << GetLastError() << endl;
exit(-);
} /*create server socket*/
if((sockfd=socket(AF_INET,SOCK_STREAM,))==INVALID_SOCKET)//创建套接字描述符
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
} /*ready for server addr*/
ZeroMemory(&server_addr,sizeof(server_addr));
ZeroMemory(&reqbuf,sizeof(reqbuf));
server_addr.sin_family=AF_INET;
server_addr.sin_addr.S_un.S_addr=htonl(INADDR_ANY);
server_addr.sin_port=htons(PORT); /*bind socket addr*/
int tmp=bind(sockfd,(struct sockaddr*)&server_addr,sizeof(server_addr));//将ip和port绑定到套接字上
if(tmp<)
{
fprintf(stderr,"Bind error %s\n",strerror(errno));
exit(-);
} /*listen*/
if((listen(sockfd,MAXLISTEN))<)//设置为被动模式
{
fprintf(stderr,"Listen error %s\n",strerror(errno));
exit(-);
}
cout<<"waiting for client ..."<<endl; /*server main while*/
// while(true)
// {
int size;
size=sizeof(struct sockaddr_in); /*accept client & create new fd*/
if((newfd=accept(sockfd,(struct sockaddr*)&client_addr,&size))<)//接受传入请求
{
fprintf(stderr,"Accept error %s\n",strerror(errno));
exit(-);
}
cout<<"Server got connect from "<<inet_ntoa(client_addr.sin_addr)<<endl; /*recv data from client*/
if((recv(newfd,reqbuf,sizeof(reqbuf),))<)//获取数据
{
fprintf(stderr,"Recv error %s\n",strerror(errno));
exit(-);
}
cout<<reqbuf<<endl; /*send data to client*/
char *sendbuf=(char*)"hello,this is server.";
if((send(newfd,sendbuf,strlen(sendbuf),))!=strlen(sendbuf))//发送数据
{
fprintf(stderr,"Send error %s\n",strerror(errno));
exit(-);
} /*close new fd*/
closesocket(newfd);//终止通信并释放套接字
// } /*close server fd*/
closesocket(sockfd);//释放套接字
WSACleanup(); cout<<"exit"<<endl; return ;
}

udpclient.cpp

 #include<iostream>
#include<WinSock2.h>
#include<sstream> #pragma comment(lib, "ws2_32") using namespace std; // #define SERVERIP "192.168.2.169"
// #define SERVERPORT 4140 void getarg(int argc,char* argv[],const char** SERVERIP,int* SERVERPORT)
{
for(int i=;i<argc;i++)
{
istringstream iss(argv[i]);
string str;
iss>>str;
if(str=="ip")
{
*SERVERIP=argv[i+];
}
else if(str=="port")
{
istringstream sts(argv[i+]);
string s_port;
sts>>s_port;
*SERVERPORT=stoi(s_port);
}
else
{ } }
} int main(int argc,char* argv[])
{
const char* SERVERIP="192.168.41.32";
int SERVERPORT=; getarg(argc,argv,&SERVERIP,&SERVERPORT); SOCKET sockfd;
struct sockaddr_in server_addr;
struct sockaddr_in client_addr;
WSADATA ws;
char* sendbuf = (char*)"hello,this is client";
char recvbuf[MAX_PATH]; //init windows socket
if (WSAStartup(MAKEWORD(, ), &ws) != )
{
cout << "Init Windows Socket Failed::" << GetLastError() << endl;
return -;
} //create socket
if ((sockfd = socket(AF_INET, SOCK_DGRAM,)) == INVALID_SOCKET)//创建套接字描述符
{
cout << "Create Socket Failed::" << GetLastError() << endl;
return -;
} ZeroMemory(&server_addr, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(SERVERPORT);
server_addr.sin_addr.S_un.S_addr = inet_addr(SERVERIP); // if ((connect(sockfd, (struct sockaddr*) & server_addr, sizeof(struct sockaddr))) < 0)
// {
// cout << "Connect Error::" << GetLastError() << endl;
// return -1;
// } if ((sendto(sockfd, sendbuf, strlen(sendbuf), ,(struct sockaddr*)&server_addr,sizeof(struct sockaddr_in))) != strlen(sendbuf))//发送数据
{
cout << "Send Error::" << GetLastError() << endl;
return -;
} ZeroMemory(&client_addr,sizeof(client_addr));
ZeroMemory(recvbuf, sizeof(recvbuf));
while (true)
{
int len=sizeof(struct sockaddr_in);
int num = recvfrom(sockfd, recvbuf, sizeof(recvbuf), ,(struct sockaddr*)&client_addr,&len);//获取数据
if (num < )
{
cout << "Recv Error::" << GetLastError() << endl;
return -;
}
else
{
cout << recvbuf << endl;
break;
}
} closesocket(sockfd);//终止通信并释放套接字
WSACleanup(); system("pause"); return ;
}

udpserver.cpp

 #include<iostream>
#include<winsock2.h>
// #include<string.h>
// #include<unistd.h> #pragma comment(lib, "ws2_32") using namespace std; #define BUFSIZE 512
#define PORT 4140
#define MAXLISTEN 128 /*error report*/
static void bail(const char *on_what){
fputs(strerror(errno), stderr);
fputs(": ", stderr);
fputs(on_what, stderr);
fputc('\n', stderr);
exit();
} int main()
{
int sockfd;//server fd
// int port;
int newfd;//connect fd
WSADATA ws;
struct sockaddr_in server_addr;
struct sockaddr_in client_addr; char reqbuf[BUFSIZE]; // signal(SIGINT,my_handler); //init windows socket
if(WSAStartup(MAKEWORD(,),&ws)!=)
{
cout << "Init Windows Socket Failed::" << GetLastError() << endl;
exit(-);
} /*create server socket*/
if((sockfd=socket(AF_INET,SOCK_DGRAM,))<)//创建套接字描述符
{
fprintf(stderr,"Socket error %s\n",strerror(errno));
exit(-);
} /*ready for server addr*/
ZeroMemory(&server_addr,sizeof(server_addr));
server_addr.sin_family=AF_INET;
server_addr.sin_addr.S_un.S_addr=htonl(INADDR_ANY);
server_addr.sin_port=htons(PORT); /*bind socket addr*/
if((bind(sockfd,(struct sockaddr*)&server_addr,sizeof(server_addr)))==INVALID_SOCKET)//将ip和port绑定到套接字上
{
fprintf(stderr,"Bind error %s\n",strerror(errno));
exit(-);
} /*server main while*/
// while(true)
// {
int size;
size=sizeof(struct sockaddr_in);
memset(&client_addr,,sizeof(client_addr)); /*recv data from client*/
if((recvfrom(sockfd,reqbuf,sizeof(reqbuf),,(struct sockaddr*)&client_addr,&size))<)//获取数据
{
fprintf(stderr,"Recvfrom error %s\n",strerror(errno));
exit(-);
}
cout<<reqbuf<<endl; /*send data to client*/
char *sendbuf=(char*)"hello,this is server.";
if((sendto(sockfd,sendbuf,strlen(sendbuf),,(struct sockaddr*)&client_addr,size))!=strlen(sendbuf))//发送数据
{
fprintf(stderr,"Sendto error %s\n",strerror(errno));
exit(-);
} // } /*close server fd*/
closesocket(sockfd);//终止通信并释放套接字
WSACleanup(); cout<<"exit"<<endl; return ;
}

参考:

基于Linux平台实现的流式套接字客户端服务器端代码

基于linux或windows平台上的c/s简单通信的更多相关文章

  1. Windows平台上Caffe的训练与学习方法(以数据库CIFAR-10为例)

    Windows平台上Caffe的训练与学习方法(以数据库CIFAR-10为例) 在完成winodws平台上的caffe环境的搭建之后,亟待掌握的就是如何在caffe中进行训练与学习,下面将进行简单的介 ...

  2. 基于linux或windows的c/s的循环服务器求一元二次方程的根

    在linux和windows上实现 c/s模式 socket循环服务器求解一元二次方程的根 ax^2+bx+c=0 根据上式,客户端发送a,b,c给服务器,返回求解的根 暂未考虑非法数据等问题 lin ...

  3. nginx 在windows平台上对asp.net做反向代理

    代理服务器 当客户机向站点提出请求时,请求将转到代理服务器.然后,代理服务器通过防火墙中的特定通路,将客户机的请求发送到内容服务器.内容服务器再通过该通道将结果回传给代理服务器.代理服务器将检索到的信 ...

  4. windows平台上MongoDB安装配置

    我按照原文方法操作,无法连接mongod服务,可能哪里出了问题. 以下是小页的教程:https://www.cnblogs.com/littlepage/p/10992336.html  视频参考: ...

  5. Windows平台上C++开发内存泄漏检查方法

    充分的利用调试工具可以非常方便地避免内存泄漏问题. 这里介绍两种方法,互为补充,第一种是VC编译器提供的方法,第二种是专用的内存泄漏检查工具Memmory Validator.这两种方法的基本原理是一 ...

  6. windows平台上用python 远程线程注入,执行shellcode

    // 转自: https://blog.csdn.net/Jailman/article/details/77573990import sys import psutil import ctypes ...

  7. Windows平台上的pip安装

    写在前面 pip 是 Python 的包管理工具,在 Python 开发中必不可少.作为一名python菜鸟,本文在踩坑无数的基础上尽可能详细地解释pip的安装过程.在安装之前需要明确两点: 1.pi ...

  8. windows平台下 c/c++进行http通信的教训

    由于需要使用c++开发一个桌面应用软件,需要用到http请求进行通讯,也是本人第一次进行网络相关的开发工作,遇到了不少坑. 由于是在windows下开发和使用的应用软件,自然而然想到了调用Window ...

  9. 基于node的tcp客户端和服务端的简单通信

    1.简单介绍下TCP/IP TCP/IP是互联网相关协议的集合,分为以下四层:应用层.传输层.网络层.数据链路层. 分成四层的好处是,假如只有一层,某个地方需要改变设计时,就必须把所有整体替换掉,而分 ...

随机推荐

  1. XSS-Labs(Level1-10)

    Level-1 简单尝试 使用基础poc<script>alert(1)</script> 代码审计 <?php ini_set("display_errors ...

  2. Element没更新了?Element没更新,基于El的扩展库更新

    think-vuele 基于Vue和ElementUI框架进行整合二次开发的一个框架.提供一些elementUI没有的或当时没有的控件.优化了或简化了便于2B软件开发的一些控件 demo:http:/ ...

  3. 跟面试官侃半小时MySQL事务隔离性,从基本概念深入到实现

    提到MySQL的事务,我相信对MySQL有了解的同学都能聊上几句,无论是面试求职,还是日常开发,MySQL的事务都跟我们息息相关. 而事务的ACID(即原子性Atomicity.一致性Consiste ...

  4. ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

    问题描述: ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory 首先检 ...

  5. 洛谷 P2257 YY的GCD 题解

    原题链接 庆祝: 数论紫题 \(T4\) 达成! 莫比乌斯 \(T1\) 达成! yy 真是个 神犇 前记 之前我觉得: 推式子,直接欧拉筛,筛出个 \(\phi\),然后乱推 \(\gcd\) 就行 ...

  6. M_map(五)

    一.圆形区域的画图 1. clear all LATLIMS=[14 22]; LONLIMS=[108 118];%南海边界范围 m_proj('miller','lon',LONLIMS,'lat ...

  7. Js闭包练习2020031801

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...

  8. 金三银四科学找工作,用python大数据分析一线城市1000多份岗位招聘需求

    文章每周持续更新,各位的「三连」是对我最大的肯定.可以微信搜索公众号「 后端技术学堂 」第一时间阅读(一般比博客早更新一到两篇) 每年的三四月份是招聘高峰,也常被大家称为金三银四黄金招聘期,这时候上一 ...

  9. Light of future-冲刺Day 6

    目录 1.SCRUM部分: 每个成员进度 SCRUM 会议的照片 签入记录 代码运行截图 用户浏览界面 订单详情界面 管理员浏览界面 新增后台界面 2.PM 报告: 时间表 燃尽图 任务总量变化曲线 ...

  10. 使用gulp自动构建项目

    网址:https://segmentfault.com/a/1190000011514257