結果
| 問題 |
No.222 引き算と足し算
|
| コンテスト | |
| ユーザー |
jj
|
| 提出日時 | 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 main
implicit none
character*20::input
integer::x,y,op,len
read *,input
len = LEN_TRIM(input)
op = find_op(input,len)
read (input(1:op-1) ,*), x
read (input(op+1:len),*), y
if(input(op:op).eq.'+') then
print '(i0)',x-y
else
print '(i0)',x+y
end if
contains
function find_op(input,len) result(op)
integer::op,len,i
character*20::input
do i=2,len
if(input(i:i).eq.'+'.or.input(i:i).eq.'-') then
op = i
return
end if
end do
end function find_op
end program main
jj