摘要: 1 #include 2 using namespace std; 3 template//定义一个通用函数,T为类型参数 4 5 6 T max(T a, T b, T c)//只能用在参数个数相同,参数类型不同 7 { 8 if (b > a) a = b; 9 if (c > a) a = c; 10 return a; 11 } 1... 阅读全文
posted @ 2018-01-28 11:38 克斯汀 阅读(143) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 double a, b, c; 9 10 cout > a >> b >> c; 12 13 if (a + b > c && b + c > a && c + a > b)//判断能否构... 阅读全文
posted @ 2018-01-27 11:47 克斯汀 阅读(192) 评论(0) 推荐(0)
摘要: 1 #include 2 using namespace std; 3 4 int main() 5 { 6 int a, b, c; 7 int *p1, *p2, *p3; 8 void swap(int *p1, int *p2); 9 void exchange(int *q1, int *q2, int *q3); 10 11 ... 阅读全文
posted @ 2017-12-10 13:59 克斯汀 阅读(150) 评论(0) 推荐(0)
摘要: //输入2个数按大到小的顺序排列 #include using namespace std; int main() { void swap(int *p1, int *p2); int a, b; int *pointer_1, *pointer_2; cin>>a>>b; pointer_1 = &a; pointer_2 = &b; ... 阅读全文
posted @ 2017-12-05 16:32 克斯汀 阅读(149) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 int main() 4 { 5 int j; 6 int year, month, day; 7 int sum = 0; //计算天数 8 int flag; //判断平年或者闰年 9 int a[][13] = { 10 ... 阅读全文
posted @ 2017-11-25 13:04 克斯汀 阅读(234) 评论(0) 推荐(0)
摘要: #include #include using namespace std; int main() { int a[11]; int i, j, t; cout>a[i]; } couta[i+1]) { t = a[i]; ... 阅读全文
posted @ 2017-11-12 11:50 克斯汀 阅读(5085) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示