結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-20 16:25:31 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 365 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-17 13:43:42 |
| 合計ジャッジ時間 | 948 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 4 WA * 3 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d %d %c", &w, &h, &c);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
int change(int);
int main() {
int w, h, x, y;
char c;
scanf("%d %d %c", &w, &h, &c);
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
printf("%c", c);
c = change(c);
}
printf("\n");
c = change(c);
}
return EXIT_SUCCESS;
}
int change(int c) {
if (c == 66)
return c + 21;
else
return c - 21;
}