結果
問題 | No.222 引き算と足し算 |
ユーザー |
![]() |
提出日時 | 2015-07-27 19:39:02 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 159 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 19,968 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 22:00:40 |
合計ジャッジ時間 | 1,068 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&x); | ^~~~~~~~~~~~~~ main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%c",&op); | ^~~~~~~~~~~~~~~ main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&y); | ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int x,y; char op; scanf("%d",&x); scanf("%c",&op); scanf("%d",&y); printf("%d\n",op=='+'?(x-y):(x+y)); return 0; }