結果

問題 No.646 逆ピラミッド
ユーザー extelo
提出日時 2018-02-12 17:58:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 171 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 66,012 KB
最終ジャッジ日時 2025-01-05 08:22:34
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:9: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
    6 | scanf("%d\n", num);
      |        ~^     ~~~
      |         |     |
      |         int*  int
main.cpp:6:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 | scanf("%d\n", num);
      | ~~~~~^~~~~~~~~~~~~
main.cpp:6:6: warning: ‘num’ is used uninitialized [-Wuninitialized]
    6 | scanf("%d\n", num);
      | ~~~~~^~~~~~~~~~~~~
main.cpp:5:5: note: ‘num’ was declared here
    5 | int num;
      |     ^~~

ソースコード

diff #

#include <iostream>

int main(void)
{
int num;
scanf("%d\n", num);
for(int i = num; i>0; i--) {
for(int j = i; j>0; j--){
printf("%d", num);
}
printf("\n");
}

return 0;
}
0