結果

問題 No.3107 45^2
ユーザー Joy Soy
提出日時 2025-04-20 15:57:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 203 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 25,728 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-04-20 15:58:00
合計ジャッジ時間 2,749 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
    6 |         scanf("%d",n);
      |                ~^  ~
      |                 |  |
      |                 |  int
      |                 int*
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d",n);
      |         ~~~~~^~~~~~~~
main.cpp:6:14: warning: ‘n’ is used uninitialized [-Wuninitialized]
    6 |         scanf("%d",n);
      |         ~~~~~^~~~~~~~
main.cpp:4:13: note: ‘n’ was declared here
    4 |         int n, ans;
      |             ^

ソースコード

diff #

#include<stdio.h>
int main(void)
{
	int n, ans;
	printf("nの二乗を計算します。1から45の整数を入力してください。");
	scanf("%d",n);
	ans = n*n;
	printf("ans=%d",ans);
	return 0;
}
0