您的位置:首页 > 编程语言 > C语言/C++

C++入门--1.0输入输出

2013-05-02 22:27 141 查看
#include<iostream>

#include<cmath>//原来C中的math.h

using namespace std;

int add(int ,int );//函数原型
int main()
{

//cout<<"Come with c++ me some time"<<endl;
////using the sqrt() function
//
//double x,y;
//cout<<"请输入要计算的要开方数!"<<endl;
//cin>>x;
//y=sqrt(x);

//cout<<"计算结果为 "<<y<<endl;
//
//cin.get();

//---------------------定义一个函数----------------------

cout<<add(2,3)<<endl;

cin.get();
return 0;
}
int add( int a,int b )
{
return a+b;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: