社区讨论
请问ends和" "有区别吗
P2241统计方形(数据加强版)参与者 10已保存回复 13
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 13 条
- 当前快照
- 1 份
- 快照标识符
- @lobalmh3
- 此快照首次捕获于
- 2023/10/29 17:52 2 年前
- 此快照最后确认于
- 2023/11/03 23:48 2 年前
输出时用ends过不了,ends和" "有区别吗?求解```cpp
#include
#include
#include
using namespace std;
int main()
{
int n,m;
long long a=0,b=0;//a正方形数 b长方形数
cin>>n>>m;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
a+=min(i,j);
b+=i*j;
}
}
b-=a;
cout<<a<<ends<<b;//改成cout<<a<<" "<<b;能AC
return 0;
}
CPP回复
共 13 条回复,欢迎继续交流。
正在加载回复...