c++入门教程–-5判断语句
c++入门教程–-5判断语句

#include<iostream>
using namespace std;
int main()
{
int a=1;
int b=1;
if(a==b) //如果成立就...
{
cout<<"相等";
}
else //如果不成立就...
{
cout<<"不相等";
}
return 0;
}
这是最基本的条件判断语句,可以从案例中学习一下。

#include<iostream>
using namespace std;
int main()
{
int a=1;
int b=1;
if(a==b) //如果成立就...
{
cout<<"相等";
}
else //如果不成立就...
{
cout<<"不相等";
}
return 0;
}
这是最基本的条件判断语句,可以从案例中学习一下。