fork download
  1. Imports System
  2.  
  3. Public Class Test
  4. Public Shared Sub Main()
  5. Dim strdata(3) As String
  6. Dim intBuil As Integer '棟
  7. Dim intFloor As Integer '
  8. Dim intRoom As Integer '部屋番号
  9. Dim intResident As Integer '入居者数
  10. Dim intCount(3, 2, 9) As Integer '各部屋(4棟3階10部屋)の入居者数
  11. Dim strOutPut As String
  12.  
  13. Console.ReadLine()
  14.  
  15. '入居者数を加算していく
  16. While True
  17.  
  18. '1件分の入居者データを半角スペースで分割し、配列に取得
  19. strdata = Console.ReadLine().Split(" ")
  20.  
  21.  
  22. '入力データがある場合は入居者数加算処理
  23. If strdata(0) <> "" Then
  24. intBuil = CInt(strdata(0)) - 1 'インデックス(棟)
  25. intFloor = CInt(strdata(1)) - 1 'インデックス(階数)
  26. intRoom = CInt(strdata(2)) - 1 'インデックス(部屋)
  27. intResident = CInt(strdata(3)) '入居者数
  28.  
  29. '入居者数を加算
  30. intCount(intBuil, intFloor, intRoom) += intResident
  31.  
  32. Else
  33. Exit While
  34. End If
  35. End While
  36.  
  37. '各部屋の入居者数を出力
  38. For intBuilIndex As Integer = 0 To 3
  39. For intFloorIndex As Integer = 0 To 2
  40. strOutPut = ""
  41. For intRoomIndex As Integer = 0 To 9
  42. strOutPut += " " + intCount(intBuilIndex, intFloorIndex, intRoomIndex).ToString
  43. Next
  44. Console.WriteLine(strOutPut)
  45. Next
  46. If intBuilIndex <> 3 Then
  47. Console.WriteLine("####################")
  48. End If
  49. Next
  50. End Sub
  51. End Class
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
1 1 3 8
3 2 2 7
4 3 8 1
compilation info
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/home/XggqxJ/<MyGenerator> (1,1) : Error VBNC99997: You've encountered something in the compiler which is not implemented. Please file a bug (see instructions here: http://mono-project.com/Bugs)
Assembly 'prog, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' saved successfully to '/home/XggqxJ/prog.exe'.
1 errors, but compilation succeeded? ShowErrors
/home/XggqxJ/<MyGenerator> (1,1) : Error VBNC99999: Unexpected error: There has been an internal error in the compiler: Consistency check failed
  at vbnc.Compiler.VerifyConsistency (Boolean result, System.String Location) [0x000a3] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:132 
  at vbnc.Compiler.Compile () [0x0049f] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:630 
Compilation took 00:00:01.2207920
stdout
Standard output is empty