結果
| 問題 |
No.646 逆ピラミッド
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-24 21:07:40 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 300 bytes |
| コンパイル時間 | 274 ms |
| コンパイル使用メモリ | 28,800 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 06:14:42 |
| 合計ジャッジ時間 | 879 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
コンパイルメッセージ
main.c: In function 'main':
main.c:9:17: warning: passing argument 1 of 'sprintf' from incompatible pointer type [-Wincompatible-pointer-types]
9 | sprintf(block, "%d", height);
| ^~~~~
| |
| int *
In file included from main.c:2:
/usr/include/stdio.h:358:38: note: expected 'char * restrict' but argument is of type 'int *'
358 | extern int sprintf (char *__restrict __s,
| ~~~~~~~~~~~~~~~~~^~~
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int height, width, block[3];
scanf("%d", &height);
width = height;
sprintf(block, "%d", height);
for (int i = 0; i < height; i++) {
for (int j = width; j > i; j--) {
printf("%s", block);
}
puts("");
}
return 0;
}