1:代码如下:
// 4.1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#includeusing namespace std;void ShowMessage(); //函数声明语句void ShowAge(); //函数声明语句void ShowIndex(); //函数声明语句void main(){ ShowMessage(); //函数调用语句 ShowAge(); //函数调用语句 ShowIndex(); //函数调用语句}void ShowMessage(){ cout << "HelloWorld!" << endl;}void ShowAge(){ int iAge=23; cout << "age is :" << iAge << endl;}void ShowIndex(){ int iIndex=10; cout << "Index is :" << iIndex << endl;}
运行结果: