結果
問題 | No.380 悪の台本 |
ユーザー |
![]() |
提出日時 | 2016-08-30 21:20:32 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 2,133 bytes |
コンパイル時間 | 573 ms |
コンパイル使用メモリ | 32,640 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-06 23:09:43 |
合計ジャッジ時間 | 2,061 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | WA * 2 RE * 6 |
コンパイルメッセージ
Main.f90:7:33: 7 | read (*,'(a)',advance='yes'),str | 1 Warning: Legacy Extension: Comma before i/o item list at (1)
ソースコード
program mainimplicit noneinteger::Ncharacter*102400::strdoread (*,'(a)',advance='yes'),strif(str(1:1).eq." ") exitif(check(str).eqv..true.) thenprint '(a)', "CORRECT (maybe)"elseprint '(a)', "WRONG!"end ifend docontainslogical function check(str) result(l)integer::icharacter*7::strendcharacter*102400::strl = .false.if(str(1:5).eq."rabi ") thendo i=6,LEN(str)if((ICHAR(str(i:i)).ge.ICHAR('a').and. &ICHAR(str(i:i)).le.ICHAR('z')).or. &(ICHAR(str(i:i)).ge.ICHAR('A').and. &ICHAR(str(i:i)).le.ICHAR('Z')).or. &(ICHAR(str(i:i)).ge.ICHAR('0').and. &ICHAR(str(i:i)).le.ICHAR('9'))) thenl = .true.returnend ifend doend ifif(LEN(str).lt.7) returncall get_capital_str(str,strend)if(str(1:5).eq."digi ") thendo i=2,5if(strend(i:i+2).eq."NYO") thenl = .true.exitend ifend doelse if(str(1:5).eq."petit ") thendo i=2,5if(strend(i:i+2).eq."NYU") thenl = .true.exitend ifend doelse if(str(1:5).eq."gema ") thendo i=1,4if(strend(i:i+3).eq."GEMA") thenl = .true.exitend ifend doelse if(str(1:5).eq."piyo ") thendo i=2,5if(strend(i:i+2).eq."PYO") thenl = .true.exitend ifend doend ifend function checkcharacter function get_capital(c) result(cc)character::cif(ICHAR(c).ge.ICHAR('a').and.ICHAR(c).le.ICHAR('z')) thencc = CHAR(ICHAR(c)-ICHAR('a')+ICHAR('A'))elsecc = cend ifend function get_capitalsubroutine get_capital_str(str, strend)integer::icharacter*7::strendcharacter*102400::strdo i=1,7strend(i:i) = get_capital(str(i+LEN_TRIM(str)-7:i+LEN_TRIM(str)-7))end doend subroutine get_capital_strend program main