結果
問題 | No.222 引き算と足し算 |
ユーザー |
![]() |
提出日時 | 2016-09-07 23:28:46 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 554 bytes |
コンパイル時間 | 2,089 ms |
コンパイル使用メモリ | 31,232 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 22:13:49 |
合計ジャッジ時間 | 1,066 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 31 |
コンパイルメッセージ
Main.f90:8:26: 8 | read (input(1:op-1) ,*), x | 1 Warning: Legacy Extension: Comma before i/o item list at (1) Main.f90:9:26: 9 | read (input(op+1:len),*), y | 1 Warning: Legacy Extension: Comma before i/o item list at (1)
ソースコード
program mainimplicit nonecharacter*20::inputinteger::x,y,op,lenread *,inputlen = LEN_TRIM(input)op = find_op(input,len)read (input(1:op-1) ,*), xread (input(op+1:len),*), yif(input(op:op).eq.'+') thenprint '(i0)',x-yelseprint '(i0)',x+yend ifcontainsfunction find_op(input,len) result(op)integer::op,len,icharacter*20::inputdo i=2,lenif(input(i:i).eq.'+'.or.input(i:i).eq.'-') thenop = ireturnend ifend doend function find_opend program main