您的位置:首页 > 编程语言 > C语言/C++

在vc++上简单搭建环境(包括文件引用)

2017-12-27 18:04 316 查看
1 // Triplet.cpp : Defines the entry point for the console application.
2 //
3
4 #include "stdafx.h"
5 #include "triplet_impl.cpp"
6
7
8 int main()
9 {
10     //初始化
11     Triplet t;
12     init_triplet(t, 1,3,2);
13     //获取第3个元素
14     ElemType e;
15     get(t,3,e);
16     printf("e=%d\n",e);
17     //设置第2个元素
18     put(t,2,4);
19     get(t,2,e);
20     printf("e=%d\n",e);
21     //判断是否 升序
22     printf("isAscending=%d\n", isAscending(t));
23     put(t,2,2);
24     printf("isAscending=%d\n", isAscending(t));
25     //取最大值
26     max(t,e);
27     printf("max=%d\n",e);
28     return 0;
29 }


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: