const

C++购书系统

家住魔仙堡 提交于 2020-04-04 00:57:03
C++购书系统——来自班里某位同学的小学期作业 这是一个购书系统,模拟网上购书的流程。用户可以在这个小程序里输入对应的数字进行浏览书籍信息,查看用户信息,查找书籍,购买书籍以及查询个人订单的操作。 以下为程序代码: #include <iostream> using namespace std; #include<fstream> #include<stdlib.h> #include<conio.h> #include<sstream> #include<iomanip> #include<windows.h> #include<string> #include"book.h" #include"buy.h" #include"search.h" //#include"strclass.h" void main() { book gx; search cz; search yh; cout<<" *********************************"<<endl; cout<<" ** 1.购书人信息 **"<<endl; cout<<" ** 2.图书信息 **"<<endl; cout<<" ** 3.图书查找 **"<<endl; cout<<" ** 4.购书 **"<<endl; cout<<" ** 5.订单信息 **"<<endl; cout<<" *

Vue webAPP首页开发(二)

北城余情 提交于 2020-04-04 00:15:07
接上篇 https://www.cnblogs.com/chenyingying0/p/12612393.html Loading组件 在api--home.js中,添加代码,使ajax获取到轮播图数据后,延迟一秒再显示 import axios from 'axios'; import {SUCC_CODE,TIMEOUT} from './config'; //获取幻灯片数据 ajax export const getHomeSliders=()=>{ // es6使用promise代替回调 // axios返回的就是一个promise // return axios.get('http://www.imooc.com/api/home/slider').then(res=>{ // console.log(res); // if(res.data.code===SUCC_CODE){ // return res.data.slider; // } // throw new Error('没有成功获取到数据'); // }).catch(err=>{ // console.log(err); // //错误处理 // return [{ // linkUrl:'www.baidu.com', // picUrl:require('assets/img/404.png') //

UISheet 和UIImageController

左心房为你撑大大i 提交于 2020-04-03 18:38:21
ios UIActionSheet UIActionSheet *uisheet=[[UIActionSheet alloc]initwithtititle:delegete:canclebutton: destructiveButtonTitle:otherbuttontitles:,nil]; ] UIimagePickerController: allwoEditing SourceType: UIImagePickerControllerSourceTypeCamera UIImagePickerControllerSourceTypePhotoLibraryMediaTypoe:kUITypeImagekUITypeMovie UIImage *img = [info objectForKey:UIImagePickerControllerEditedImage]; self.fileData = UIImageJPEGRepresentation(img, 1.0);// NSString *videoPath = [[info objectForKey:UIImagePickerControllerMediaURL] path]; self.fileData = [NSData dataWithContentsOfFile:videoPath]; iOS 获取图片

react 入门教程~

眉间皱痕 提交于 2020-04-03 14:32:56
1.安装 1.1 创建一个全新的应用 //全局安装 npm install -g create-react-app //创建新应用 my-app是文件夹名称 create-react-app my-app cd my-app npm start 1.2 加入到存入的项目中 yarn yarn init yarn add react react-dom npm npm init npm install --save react react-dom 1.3 使用cdn <script crossorigin src="https://unpkg.com/react@15/dist/react.js"></script> <script crossorigin src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> 2.'hello world' domo import React from "react"; import ReactDOM from "react-dom"; ReactDOM.render( <h1>Hello, world!</h1>, document.getElementById('app') ); 3.介绍jsx import React from "react"; import

27-React Lists and Keys

送分小仙女□ 提交于 2020-04-03 13:25:13
Lists and Keys React支持以数组的形式来渲染多个组件,它会将你数组中的每个组件以列表的形式渲染开来。 当你使用数组的方式来渲染你的组件时,你需要给每个组件一个Key值,否则会出现一个警告,提示指出应该为列表的每一项提供一个属性key,如下代码所示: function NumberList(props) { const numbers = props.numbers; const listItems = number.map(item => <li>{item}</li>); return ( <ul>{listItems}</ul> ); } const numbers = [1, 2, 3, 4, 5]; ReactDOM.render( <NumberList numbers={numbers} />, document.getElementById('root') ) 分配key后的代码如下: function NumberList(props) { const numbers = props.numbers; const listItems = numbers.map(item => <li key={item.toString()}> {item} </li> ); return ( <ul>{listItems}</ul> ) } const

CFileFind类的使用总结

六月ゝ 毕业季﹏ 提交于 2020-04-03 11:46:56
CFileFind类的使用总结(转) CFileFind类的使用总结 2007-7-7 1、CFileFind类的声明文件保存在afx.h头文件中。 2、该类的实现的功能:执行本地文件的查找(查找某个具体的文件,查找某类文件x*.x*,查找所有文件*.*) 3、CFileFind类是CGopherFileFind和CFtpFileFind类的基类。 4、CFileFind类的构造函数::CFileFind()和关闭函数::Close()我会成对使用。 5、CFileFind类的成员函数我根据其操作特性划分为3类:查找操作类、获得文件属性类、判断文件属性类。(下面我先进行函数罗列并没有完整的描述函数的参数) 查找操作类 ::FindFile(); ::FindNextFile(); 获得文件属性类 ::GetCreationTime(); ::GetLastAccessTime(); ::GetLastWriteTime(); ::GetFileName(); ::GetRoot(); ::GetFilePath(); ::GetFileTitle(); ::GetFileURL(); ::GetLength(); 判断文件属性类 ::IsArchived(); ::IsCompressed(); ::IsDirectory(); ::IsDots(); ::IsHidden();

[Next.js] Consume Next.js API routes with the SWR library on the client-side

久未见 提交于 2020-04-03 05:11:05
The cool thing about Next.js API routes is that we can directly consume the API endpoints from pages. SWR is a nice tool for handling data loading state in React apps using hooks, and is a perfect companion for our Next.js application. In this lesson, we will learn how to use SWR - a data fetching library by Zeit - to consume API endpoints on the client-side, and conditionally render an error or a loading component when the data is not available. pages/api/user/[id].ts: import { NextApiHandler } from "next"; const data = [ { id: 1, name: "Wan" }, { id: 2, name: "Zhen" }, { id: 3, name: "Tian"

接口继承和实现继承

纵饮孤独 提交于 2020-04-03 04:29:29
设计类(class)的时候,你可能会干下面这几件事情: 1.只让继承类(derived class)继承成员函数的接口; 2.让derived class同时继承函数的接口和实现,但又能覆写所继承的实现; 3.同时继承函数的接口和实现,但不允许覆写任何东西; 以下面的类为例,来解释上面的三种实现: class Shape { public: virtual void draw() const = 0; virtual void error(const std::string& msg); int objectID() const; ... }; class Rectangle: public Shape{...}; class Ellipse: public Shape{...}; 对于draw函数,其实我们是可以调用的:如下: Shape *ps = new Shpae;   //Error! Shape is abstract Shape *ps1 = new Rectangle;   //ok ps1->draw(); //call Rectangle::draw Shape *ps2 = new Ellipse; //ok ps2->draw(); //Ellipse::draw ps1->Shape::draw(); //Shape::draw ps2->Shpae:

最小生成树(模板+入门题)

点点圈 提交于 2020-04-02 23:39:38
最小生成树 加权图是一种为每条边关联一个权值(可表示成本、时间等)的图模型。这种图能表示许多场景,如航空图中边表示航线,权值表示距离或费用。在航空图中,通常的问题是如何使距离或费用最小化。 我们可以通过加权无向图的最小生成树来解决这个问题。 图的生成树:是它的一颗含有其他所有顶点的无环连通子图。一幅加权无向图的最小生成树(MST)是它的一颗权值最小的生成树(树中所有边的权值之和最小)。 我们会一起学习计算最小生成树的两种经典算法:Prime算法和Kruskal算法。 首先有几个注意点: 只考虑连通图 边的权值可以表示距离、时间、费用或其他变量 边的权重可能是0或负数 所有边的权重都不相同 我们要在一幅加权连通无向图中找到它的最小生成树。 首先定义一下 加权无向图的数据结构 最小生成树算法:Prim算法和Kruskal算法 Prim算法: Prim算法 模板: 1 #include <stdio.h> 2 #include <string.h> 3 #include <iostream> 4 #include <string> 5 #include <math.h> 6 #include <algorithm> 7 #include <vector> 8 #include <stack> 9 #include <queue> 10 #include <set> 11 #include

C++11 - 类型推导auto关键字

≡放荡痞女 提交于 2020-04-02 20:12:50
/*--> */ /*--> */ /*--> */ /*--> */ /*--> */ /*--> */ /*--> */ /*--> */ 在C++11中,auto关键字被作为类型自动类型推导关键字 (1)基本用法 C++98:类型 变量名 = 初值; int i = 10; C++11:auto 变量名 = 初值; auto i = 3.14; 借助于auto关键字,可对变量进行隐式的类型定义,即由编译器在编译期间根据变量的初始化语句,自动推断出该变量的类型. auto a = 1;//a被推导为int auto b = new auto(2);//b推导为int* auto const *c = &a;// 在旧语法中,auto型变量存储于栈区,static型变量存储于静态区,二者不能同时使用,但c++11的auto关键字已经不再作为存储类型指示符 static auto i = 4; auto int j; //error auto并不能代表一个世纪的类型声明,只是一个类型声明的占位符,使用auto声明的变量必须马上初始化,以让编译器推断出它的实际类型并在编译剪短将auto替换为真的类型 auto k; //error (2)auto同指针或引用结合使用 即使不把auto声明为指针,其亦可被推导为指针类型 int a = 0; auto *b = &a; //auto