結果

問題 No.987 N×Mマス計算(基本)
ユーザー mmn15277198mmn15277198
提出日時 2020-02-25 21:06:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 65,156 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-21 15:40:52
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
	int a;//tate
	int b;//yoko
	char c;//+or*
	cin >> a >> b;
	int p[a+1][b+1];
	
	cin >> c;
	
	for(int i=1;i<=b;i++){
		cin >> p[0][i];
		//cout << "yoko" <<p[0][i] << endl;
	}
	
	for(int j=1;j<=a;j++){
		cin >> p[j][0];
		//cout << "tate" << p[j][0] << endl;
	}
	
	cout << endl;
	
	for(int k=1;k<=a;k++){//tate
		for(int l=1;l<=b;l++){//yoko
			if(c=='+'){
				p[k][l]=p[k][0]+p[0][l];
			}
			if(c=='*'){
				p[k][l]=p[k][0]*p[0][l];
			}
			cout << p[k][l] << " ";
			if(l==b)cout << endl;
		}
	}
return 0;
}
0