摘要: 1 package main 2 3 import ( 4 "encoding/json" 5 "fmt" 6 "github.com/julienschmidt/httprouter" 7 "net/http" 8 ) 9 10 //ResponseWriter是一个接口 拥有三个方法 Write 阅读全文
posted @ 2020-03-30 13:56 萌萌~ 阅读(2302) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <fstream> 3 4 using namespace std; 5 6 void check_cin (istream &is) 7 { 8 if(is.bad())//系统级的错误才会bad 9 { 10 cout<<"cin 阅读全文
posted @ 2020-03-30 08:34 萌萌~ 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <string> 3 //#include "Sales_item.h" 4 #include "Sales_item.cpp" 5 6 using namespace std; 7 //使用typedef简化定义 8 typedef 阅读全文
posted @ 2020-03-29 09:14 萌萌~ 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 3 4 5 using namespace std; 6 7 //通过指针进行传递 8 void print_Values(int *x,size_t n) 9 { 10 for(size_t i=0;i!=n;i++) 11 { 12 cout<<x 阅读全文
posted @ 2020-03-27 16:25 萌萌~ 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 推荐的做法是使用迭代器当做形参 1 #include <iostream> 2 #include <new> 3 #include <bitset> 4 #include <string> 5 #include <stdexcept> 6 #include <vector> 7 8 9 using 阅读全文
posted @ 2020-03-27 12:52 萌萌~ 阅读(637) 评论(1) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <new> 3 #include <bitset> 4 #include <string> 5 #include <stdexcept> 6 7 8 using namespace std; 9 10 11 12 //非引用形参 传递 阅读全文
posted @ 2020-03-27 09:37 萌萌~ 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include<stdlib.h> 3 #include<string> 4 #include<vector> 5 #include<cstring> 6 #include<bitset> 7 8 9 using namespace std; 10 阅读全文
posted @ 2020-03-23 14:19 萌萌~ 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include<stdlib.h> 3 #include<string> 4 #include<vector> 5 #include<cstring> 6 7 8 using namespace std; 9 typedef int int_arra 阅读全文
posted @ 2020-03-22 20:34 萌萌~ 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include<stdlib.h> 3 4 5 using namespace std; 6 7 int main() 8 { 9 //创建动态数组 10 int a[10]; //静态数组 堆栈上创建的 11 int n; 12 cin>>n; 1 阅读全文
posted @ 2020-03-22 10:04 萌萌~ 阅读(913) 评论(0) 推荐(1) 编辑
摘要: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 5 6 using namespace std; 7 8 int main() 9 { 10 11 string s("hello world!"); //定义一个字符串并 阅读全文
posted @ 2020-03-22 08:34 萌萌~ 阅读(163) 评论(0) 推荐(0) 编辑