結果
| 問題 | 
                            No.432 占い(Easy)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             jj
                         | 
                    
| 提出日時 | 2016-10-14 22:52:26 | 
| 言語 | Fortran  (gFortran 14.2.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 585 bytes | 
| コンパイル時間 | 865 ms | 
| コンパイル使用メモリ | 32,256 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-22 08:18:31 | 
| 合計ジャッジ時間 | 2,145 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 16 WA * 6 | 
ソースコード
program main
  implicit none
  integer::T,i,j,len
  character*100::S
  integer::ss(100)
  read *,T
  do i=1,T
     read *,S
     len = LEN_TRIM(S)
     do j=1,len
        ss(j) = ICHAR(S(j:j))-ICHAR('0')
     end do
     call uranai(ss, len)
  end do
contains
  subroutine uranai(ss, len)
    integer::ss(100)
    integer::len,i,j,tmp
    do i=1,len-1
       do j=1,len-i
          ss(j) = ss(j) + ss(j+1)
          if(ss(j).ge.10) then
             ss(j) = ss(j)/10 + ss(j)-10
          end if
       end do
    end do
    print '(i0)', ss(1)
  end subroutine uranai
end program main
            
            
            
        
            
jj