72 条题解
信息
- ID
- 652
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 4
- 标签
- 递交数
- 8896
- 已通过
- 4399
- 上传者
不会吧,不会吧,不会有人这么简单的代码都不会吧😄
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a == b)
{
cout << "Y" << endl;
}
else
{
cout << "N" << endl;
}
cout << a * b;
return 0;
}
###一个简单的判断,上代码!###
#include <bits/stdc++.h>//万能开头
using namespace std;
int x,z;//定义变量
int main()
{
cin>>x>>z;//输入变量
if(x==z)//如果两边一样长(正方形)
{
cout<<"Y"<<endl;
}
else
{
cout<<"N"<<endl;
}
cout<<x*z;//输出面积
return 0;
}
//一手交赞,一手交货(代码)
//核桃hetao1609095编程
//水印
LTC
#include<iostream>
using namespace std;
int main()
{ //T T
int a,b;//|____________|
cin>>a>>b;//////////////
if(a==b)
{
cout<<"Y"<<endl;
}
else
{
cout<<"N"<<endl;
}
cout<<a*b;
return 0;
}
#include <bits/stdc++.h>//头文件
using namespace std;//使用命民空间
int main()//主函数
{
int x,y;//定义变量x和y
cin>>x>>y;//输入变量x和y
if(x==y)//条件判断:条件成立
{
cout<<"Y"<<endl;//输出Y(Yes)
}
else//条件判断:条件不成立
{
cout<<"Y"<<endl;//输出n(no)
}
cout<<x*y;//输出x*y #正四边形=长(x)*宽(y)
return 0;//了当,直接return 0
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==b)//判断条件
{
cout <<"Y"<<endl;//注意引号
}
else
{
cout <<"N"<<endl;
}
cout << a*b;
return 0;
}
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if(a==b) { cout<<"Y"<<endl; } else { cout<<"N"<<endl; } cout<<a*b<<endl; return 0; }
```#include <iostream>
````using namespace std;
```int main()
```{
``` int a;
```int b;
```cin >> a >> b;
``` if (a == b)
``` {
`` cout << "Y" << endl << a*b;
``` }
else
``` {
``` cout << "N" <<endl << a*b;
``` }
``` return 0;
```}
#include <iostream> using namespace std;
int main() { int a, b; cin >> a >> b;
int area = a * b; cout << (a == b ? "Y" : "N") << endl; cout << area << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
a*=b;
if(a%4==0)
{
cout<<"Y"<<endl<<a;
}
else
{
cout<<"N"<<endl<<a;
}
}
//这道题太简单,先判断、后输出,代码走起!
#include <bits/stdc++.h>
using namespace std;
int a, b;
int main()
{
cin >> a >> b;
if (a == b)
{
cout << "Y" << endl;
cout << a * b << endl;
}
else
{
cout << "N" << endl;
cout << a \* b << endl;
}
return 0;
}//编码不易,先点赞后抱走啊😄
//这道题太简单,先判断、后输出,代码走起!
#include <bits/stdc++.h> using namespace std; int a, b; int main() { cin >> a >> b; if (a == b) { cout << "Y" << endl; cout << a * b << endl; } else { cout << "N" << endl; cout << a * b << endl; } return 0; }//编码不易,先点赞后抱走啊😄
#include <bits/stdc++.h>
using namespace std;
int a, b;
int main()
{
cin >> a >> b;
if (a == b)
{
cout << "Y" << endl;
cout << a * b << endl;
}
else
{
cout << "N" << endl;
cout << a * b << endl;
}
return 0;
}//编码不易,先点赞后抱走啊😄
#include <bits/stdc++.h>
using namespace std;
int a, b;
int main()
{
cin >> a >> b;
if (a == b)
{
cout << "Y" << endl;
cout << a * b << endl;
}
else
{
cout << "N" << endl;
cout << a * b << endl;
}
return 0;
}//编码不易,先点赞后抱走啊😄
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;//定义
cin >> a >> b;//输入
if (a==b)//是
{
cout << "Y" << endl << a*b;
}
else//不是
{
cout << "N" << endl << a*b;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
if (a==b)
{
cout <<"Y"<<endl;
}
else
{
cout <<"N"<<endl;
}
cout << a*b;
return 0;
}
yinggaiduiba,我通过了
万能头,更顺手一点,iostream好打一点。
#include <iostream>
using namespace std;
int main()
{
int n,m;
cin >> n >> m;
if(n == m)
{
cout << "Y" << endl << n * m;
}
else
{
cout << "N" << endl << n * m;
}
return 0;
}
这道题一样灰常的简单。只要:
定义变量
选择判断
打印判断结果(相不相等?)
打印变量的积即可。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
char z = 'N';
cin >> x >> y;
if (x == y) z = ' Y ';
cout << z << endl << x * y << endl;
re turn 0;
}
小盆友们,您学会了吗?
欧克,赞赞已上交
foo.cc:8:21: warning: multi-character character constant [-Wmultichar]
8 | if (x == y) z = ' Y ';
| ^~~~~
foo.cc: In function 'int main()':
foo.cc:8:21: warning: overflow in conversion from 'int' to 'char' changes value from '2119968' to '' '' [-Woverflow]
# | 状态分数 | 耗时 | 内存占用 |
---|---|---|---|
-------------------------------------------------------------- | |||
#1 | Wrong Answer 0读取到 ,应为 Y。 | 1ms | 376 KiB |
- | |||
识别错误,我要退货,还有差评T~T |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
if(a == b)
{
cout << "Y" << endl;
}
else
{
cout << "N" << endl;
}
cout << a * b;
return 0;
}