/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称: test.cpp
*作 者:陈丹
*完成日期:2014年11月17日
*版本号:v1.0
*
*问题描述:
*输入描述:
*程序输出:
*/
#include <iostream>
using namespace std;
int a=3, b=5;
int max(int a, int b)
{
int c;
c=a>b? a:b;
return c;
}
int main()
{
int a=8;
cout<<max(a,b)<<endl;
return 0;
}
运行结果:
/*
*Copyright (c) 2014,烟台大学计算机学院
*All rights reserved.
*文件名称: test.cpp
*作 者:陈丹
*完成日期:2014年11月17日
*版本号:v1.0
*
*问题描述:
*输入描述:
*程序输出:
*/
#include <iostream>
using namespace std;
void cude();
int main()
{
extern int x;
x=5;
cude();
cout<<x<<endl;
return 0;
}
int x=10;
void cude()
{
x=x*x*x;
}
运行结果:
本文介绍了一个简单的C++程序,包括函数定义、变量声明、条件判断和输出操作。详细解释了程序的主要功能和运行结果,适用于初学者理解和学习C++编程的基本概念。

被折叠的 条评论
为什么被折叠?



