結果

問題 No.280 歯車の問題(1)
ユーザー 184
提出日時 2015-09-18 22:43:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 251 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 34,176 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-19 07:04:04
合計ジャッジ時間 5,875 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:40: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
    9 |         int n;long long z[101];scanf("%d",n);for(int i=0;i<n;i++)scanf("%lld",&z[i]);
      |                                       ~^  ~
      |                                        |  |
      |                                        |  int
      |                                        int*
main.cpp:9:37: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         int n;long long z[101];scanf("%d",n);for(int i=0;i<n;i++)scanf("%lld",&z[i]);
      |                                ~~~~~^~~~~~~~
main.cpp:9:71: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         int n;long long z[101];scanf("%d",n);for(int i=0;i<n;i++)scanf("%lld",&z[i]);
      |                                                                  ~~~~~^~~~~~~~~~~~~~
main.cpp:9:37: warning: ‘n’ is used uninitialized [-Wuninitialized]
    9 |         int n;long long z[101];scanf("%d",n);for(int i=0;i<n;i++)scanf("%lld",&z[i]);
      |                                ~~~~~^~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

//namaega184

int main(){
	int n;long long z[101];scanf("%d",n);for(int i=0;i<n;i++)scanf("%lld",&z[i]);
	long long ans;
	
	printf("%lld/%lld\n",z[n-1],z[0]);
	return 0;
}
0