回答編集履歴
2
ソース追記
test
CHANGED
@@ -7,3 +7,55 @@
|
|
7
7
|
[scanf 関数の変換指定子](https://webkaru.net/clang/scanf-format-specifiers/)
|
8
8
|
|
9
9
|
[scanf](http://www.c-tipsref.com/reference/stdio/scanf.html)
|
10
|
+
|
11
|
+
「追記」
|
12
|
+
|
13
|
+
```text
|
14
|
+
|
15
|
+
usr ~/Project/test % ./a.out
|
16
|
+
|
17
|
+
1.586863
|
18
|
+
|
19
|
+
1.560966
|
20
|
+
|
21
|
+
1.535381
|
22
|
+
|
23
|
+
usr ~/Project/test % cat t2.c
|
24
|
+
|
25
|
+
#include <stdio.h>
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
/*main関数*/
|
30
|
+
|
31
|
+
int main(void)
|
32
|
+
|
33
|
+
{
|
34
|
+
|
35
|
+
const char *v[] = {
|
36
|
+
|
37
|
+
"1,1.586863293",
|
38
|
+
|
39
|
+
"2,1.560966016",
|
40
|
+
|
41
|
+
"3,1.535381068"};
|
42
|
+
|
43
|
+
//
|
44
|
+
|
45
|
+
double d;
|
46
|
+
|
47
|
+
for(int i = 0; i < 3; i++) {
|
48
|
+
|
49
|
+
sscanf(v[i], "%*d,%le", &d);
|
50
|
+
|
51
|
+
printf("%lf\n", d);
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
return 0;
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
```
|
1
追記
test
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
参考↓
|
4
4
|
|
5
|
+
[入力時に不要なデータをスキップ](https://edu.clipper.co.jp/pg-2-56.html)
|
6
|
+
|
5
7
|
[scanf 関数の変換指定子](https://webkaru.net/clang/scanf-format-specifiers/)
|
6
8
|
|
7
9
|
[scanf](http://www.c-tipsref.com/reference/stdio/scanf.html)
|