結果

問題 No.441 和か積
ユーザー jjjj
提出日時 2016-11-20 16:59:33
言語 Fortran
(gFortran 14.2.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 894 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 31,872 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 00:54:03
合計ジャッジ時間 2,829 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:7:15:

    7 |      read(sa,*),a
      |               1
Warning: Legacy Extension: Comma before i/o item list at (1)
Main.f90:8:15:

    8 |      read(sb,*),b
      |               1
Warning: Legacy Extension: Comma before i/o item list at (1)
Main.f90:24:19:

   24 |         write(sa,*),a
      |                   1
Warning: Legacy Extension: Comma before i/o item list at (1)
Main.f90:31:19:

   31 |         write(sb,*),b
      |                   1
Warning: Legacy Extension: Comma before i/o item list at (1)

ソースコード

diff #

program main
  implicit none
  character*200::sa,sb
  integer::a,b,space
  read *,sa,sb
  if(LEN_TRIM(sa).eq.1.and.LEN_TRIM(sb).eq.1) then
     read(sa,*),a
     read(sb,*),b
     if(a.eq.0.or.b.eq.0) then
        if(a.eq.0.and.b.eq.0) then
           print '(a)',"E"
        else
           print '(a)',"S"
        end if
     else if(a.eq.1.or.b.eq.1) then
        print '(a)',"S"
     else if(a.eq.2.and.b.eq.2) then
        print '(a)',"E"
     else
        print '(a)',"P"
     end if
  else
     if(LEN_TRIM(sa).eq.1) then
        write(sa,*),a
        if(a.le.1) then
           print '(a)',"S"
        else
           print '(a)',"P"
        end if
     else if(LEN_TRIM(sb).eq.1) then
        write(sb,*),b
        if(b.le.1) then
           print '(a)',"S"
        else
           print '(a)',"P"
        end if
     else
        print '(a)',"P"
     end if
  end if
end program main
0