book3.cc
来自「做为SD0609的一员,我扎实的基础是如何打出来的,来看看我那时连猴子选大王都不」· CC 代码 · 共 46 行
CC
46 行
#include <iostream>using namespace std;struct Book{ char name[30]; float price; int num;};void input(Book*);void outpput(Book*);void sortp(Book* book_array,int len);void sortn(Book* book_array,int len);int main(int argc,char* argv[]){ Book b[5]; cout << "input name,price,and num of 5 book;" << endl; input(b,5); cout << "sort by price:" << endl; sortp(b,5); output(b); return 0;}void input(Book* p, int len){ for(int i=0; i<len; i++){ cin >> p->name >> p->price >> p->num; p++; ]}void output(Book* p, int len){ for(int i=0; i<len; i++){ cout << p->name << ':' << p->price << ':' << p->num; p++; ]}void sortp(Book* p, int len){ for(int i=0; i<len; i++){ for(int j=0; j<i; j++){ } cout << p->name << ':' << p->price << ':' << p->num; p++; ]}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?