- 博客(17)
- 资源 (7)
- 收藏
- 关注
原创 函数重用和函数引用结合测试
#include#includeusing namespace std;template Any maxn(const Any *p, int n);template(const string *p, int n);int main(){int arr[7] = { 1,5,24,423,123,14,53 };double dor[4]
2015-12-12 17:22:42 349
原创 函数的重用
#includeusing namespace std;#includestruct stringy{char *str1;int ct;};void set(stringy &str, const char *st);void show(const stringy &str, int n = 1);void show(const char* str
2015-12-12 16:56:36 954
原创 给结构赋值和显示
#includeusing namespace std;struct CandyBar{char *p;double dr;int init;};void init_bar(CandyBar &bar, char *pf = "Millennium Munch", double df = 2.85, int inf = 350);void show(const
2015-12-12 16:30:25 420
原创 打印字符串次数,采用简单递归
#includeusing namespace std;void show(char *str, int n = 1);int main(){char *str = "sfhjsdahggasdg";show(str,15);cin.get();cin.get();return 0;}void show(char *str, int n)
2015-12-12 16:20:21 256
原创 简单利用模板的例子
#includeusing namespace std;templatevoid Swap(Any &a, Any &b);int main(){int i = 20;int j = 10;Swap(i, j);cout cin.get();cin.get();return 0;}templatevoid Swap
2015-12-12 15:34:10 236
原创 函数指针
#includeusing namespace std;double add(double x, double y);double calculate(double x, double y, double(*pf)(double, double));int main(void){using namespace std;int x, y;x = y = 0;
2015-12-11 23:55:29 211
原创 结构的使用
#includeusing namespace std;const int M = 5;struct box{char maker[40];float height;float width;float length;double volume;};void print_array(box *name,int number);//显示每一个成员的值
2015-12-09 18:03:48 269
原创 编写程序 分别使用输入 输出 求平均值函数
#include#includeusing namespace std;const int SIZE = 10;struct GOLF{char name[SIZE];float grade;};void init_array(GOLF *str);void print_array_name(GOLF str);void prin
2015-12-09 17:43:42 1830
原创 计算调和平均数
#includeusing namespace std;double subdivide(const double x,const double y);int main(void){using namespace std;double x, y;cout while (cin >> x >> y && x&&y){cout cout
2015-12-09 16:29:13 1365
原创 读写相同的大型数据
#include#include#includestruct MOVIE{int number;int name;double grade;long rating;MOVIE *next;};int main(){using namespace std;string filename = "ratings.txt"
2015-12-08 03:06:01 301
原创 读取文件中的字符个数,包括空格等
#include#include#includeint main(){using namespace std;string filename = "text.txt";ifstream inFile;int i = 0;char ch;inFile.open(filename);if (!inFile.is_open(
2015-12-08 00:42:36 694
原创 单词识别 c++ primer plus 第六章变成练习 第7题
#include#includeconst int STRSIZE = 20;int main(){using namespace std;int i = 0;int m = 0;string *str = new string[STRSIZE];cout while (1){cin >> str[i];++i;if
2015-12-08 00:11:26 283
原创 c++ primer plus 第六章变成练习 第7题
#include#includeconst int STRSIZE = 20;int main(){using namespace std;int i = 0;int m = 0;string *str = new string[STRSIZE];cout while (1){cin >> str[i];++i;if
2015-12-08 00:08:49 274
原创 c++ primer plus 第六章变成练习 第4题
#includeconst int STRSIZE = 20;const int BOBSIZE = 3;struct bob{char fullname[STRSIZE];char title[STRSIZE];char bobname[STRSIZE];char preferrence;};int main(){using namespa
2015-12-07 23:32:21 248
原创 结构体的题
#includeconst int STRSIZE = 20;const int BOBSIZE = 3;struct bob{char fullname[STRSIZE];char title[STRSIZE];char bobname[STRSIZE];char preferrence;};int main(){using namespa
2015-12-07 23:31:26 232
原创 c++ primer plus 第六章变成练习 第2题
#includeconst int SIZE = 10;int main(){using namespace std;double *s = new double [SIZE];int i = 0;cout while (i {cin >> s[i];if (cin.fail()){cout break;}cout
2015-12-07 16:13:39 244
原创 c++ primer plus 第六章变成练习 第一题
#include#includeint main(){using namespace std;string str;cin >> str;cout int n = 0;n = str.length();for (int i = 0;i {if (tolower(str[i]) != str[i])str[i] = towlower(str
2015-12-07 15:32:26 282
Visual Assist X.zip
2019-05-13
Luajit for cpp
2018-07-04
windows系统下svn update失败的解决方法,绝对有效
2016-12-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人