函数声明和使用
#include<iostream>
using namespace std;
int sum(int a,int b);//函数声明
int main()
{
cout << sum(1,2);//函数调用
return 0;
}
int sum(int a,int b)//函数主体
{
return a+b;
}#include<iostream>
using namespace std;
int sum(int a,int b);//函数声明
int main()
{
cout << sum(1,2);//函数调用
return 0;
}
int sum(int a,int b)//函数主体
{
return a+b;
}Windows 用户 现在,请您打开之前已经安装好了的Dev C++软件,点击左上角的“文件”-“新建”-“源代码”。并在打开的编辑器里面粘贴以下代码:#include <iostream>...
#include <iostream> using namespace std; int addnum(int a,int b) { return a+b; } int ...
#include <iostream> using namespace std; class fenshu { public: int xuehao; int yuwen; }; ...
#include <iostream>using namespace std;int main(){ cout << "Hello, world!...
#include<iostream> using namespace std; int main() { int x=0; for(x=0;x<10;x++) { if(x==3) break;...