正在加载图片...
面向对象程序设计 例:内嵌函数的定义使用 #include <iostream h?> inline int max(int a, int b) if( a>b)return a 堂提要 else return b 第五章C++基础 void main() 51C++概述 cout Enter two integers 52数据和表达式 cin>>X>>y 53基本语句 cout max- max(xy)<endl;}54函数 55数组与指针 结果: Enter two integers:1028 max 28第五章 C++基础 5.1 C++概述 5.2 数据和表达式 5.3 基本语句 5.4 函数 5.5 数组与指针 例:内嵌函数的定义使用 #include <iostream.h> inline int max(int a, int b); { if( a>b) return a; else return b; } void main( ) { int x, y; cout << "Enter two integers: "; cin >> x >> y; cout << " max= " << max(x,y) << endl; } 结果: Enter two integers: 10 28 max= 28
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有