回答編集履歴
1
追記
test
CHANGED
@@ -25,3 +25,29 @@
|
|
25
25
|
}
|
26
26
|
|
27
27
|
```
|
28
|
+
|
29
|
+
**追記**
|
30
|
+
|
31
|
+
別解
|
32
|
+
|
33
|
+
```C
|
34
|
+
|
35
|
+
#include <stdlib.h> // strtod
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
for (i = 0; i < x; i++) {
|
40
|
+
|
41
|
+
char s[256], *p = fgets(s, sizeof s, file);
|
42
|
+
|
43
|
+
for (j = 0; j < y; j++) {
|
44
|
+
|
45
|
+
A[i][j] = (*p=='\t'|| *p=='\n') ? 0 : strtod(p, &p);
|
46
|
+
|
47
|
+
p++;
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
```
|