1:代码如下:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
// 4.1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using 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; }
运行结果: