为什么全错,运行出来正确结果了
查看原帖
为什么全错,运行出来正确结果了
759651
fengfenglong楼主2022/8/17 00:48
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <bits/stdc++.h>
#include <math.h>
#include <string>

using namespace std;
//#define PI 3.1415926
//int n;
int main()
{
int n,m;
std::cin>>n>>m;
int a[2*n][m];
int b[n][m];
for(int i=1;i<=2*n;i++)
for(int j=1;j<=m;j++)
std::cin>>a[i][j];
for(int i=1;i<=n;++i)
{for(int j=1;j<=m;++j)
{b[i][j]=a[i][j]+a[i+m][j];
std::cout<<b[i][j]<<' ';
}
cout<<endl;
}
return 0;
}
2022/8/17 00:48
加载中...