質問編集履歴

1

エラーコード

2022/04/06 11:53

投稿

Glass
Glass

スコア15

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,8 @@
14
14
 
15
15
  ```
16
16
  /root/src/src/MainApp.cs(23,24): error CS0117: 'Math' does not contain a definition for 'abs' [/root/src/MainApp.csproj]
17
+
18
+ Math.Absの部分を修正した所 Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array. at MainApp.Main(String[] args) in /root/src/src/MainApp.cs:line 19(int.Parseの所) Command terminated by signal 6 上記のエラーコードが検出されました。
17
19
  ```
18
20
 
19
21
  ### 該当のソースコード
@@ -34,7 +36,7 @@
34
36
 
35
37
  int b = int.Parse(tbl[1]);
36
38
 
37
- int val = Math.abs(a-b);
39
+ int val = Math.Abs(a-b);
38
40
 
39
41
  if( val >= 10 )
40
42
  {