简介
全在注释里,希望能对大家有所帮助吧。
代码
//-----自定义函数-----
#include <iostream>
using namespace std;
bool bo(int a);//先声明再使用是一个好习惯 bool:返回true或false
int in(int b);
char ch(int c);
void vo(int d);//void:不返回值
int main()
{
int n,m,x,y;
cin>>n;
cout<<bo(n)<<endl;//调用函数
cin>>m;
cout<<in(m)<<endl;
cin>>x;
cout<<ch(x)<<endl;
cin>>y;
vo(y);
return 0;
}
bool bo(int a)
{
if(a)//a不为0
return true;//结束
return false;
}
int in(int b)
{
return b;
}
char ch(int c)
{
return (char)c;
}
void vo(int d)
{
cout<<d<<endl;//不返回
}

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



