
C++
TToolss
——————————————
展开
-
使用选择排序法实现按字典顺序排序
//文件说明:使用选择排序法实现按字典顺序排序#include <iostream>using namespace std;void sort(char *name[],int n){ int k; //临时变量,用于每次比较后存储下标值 char *temp; //临时变量,用于字符串交换 for (size_t i = 0; i < n-1...原创 2019-07-07 16:04:05 · 1374 阅读 · 0 评论 -
使用结构体数组实现投票计数器
//文件说明:使用结构体数组实现投票计数器#include <iostream>#include <string>using namespace std;struct v //声明结构体v{ int count; //计数 string name; //姓名};void vote(){ string putName; ...原创 2019-07-08 14:53:51 · 683 阅读 · 0 评论