※ 引述 《sustainer123 (caster)》 之銘言:
:
: 我要input
: (-2.5,0),(0.5,4),(4.5,1),(1.5,-3)
: (3,-2),(-3,-2),(-3,2),(3,2)
:
: 我寫
: double x1, y1, x2, y2, x3, y3 x4, y4, x5, y5, x6, y6, x7, y7, x8, y8;
:
: scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y
4)
: ;
: scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x5, &y5, &x6, &y6, &x7,&y7,&
x8
: , &y8
: );
:
: 跑出來的結果是0
:
: 為什麼輸入不進去R?
:
: 直接輸入數字沒問題 複製()就GG
本來在想迴圈怎麼寫
後來想不到
之後改成這樣就過了
double x1, y1, x2, y2, x3, y3, x4 ,y4;
scanf("(""%lf"", ""%lf"")" ", ""(""%lf"", ""%lf"")" ", ""(""%lf"", ""%lf"")"
", ""(""%lf"", ""%lf"")" , &x1, &y1, &x2, &y2 , &x3, &y3, &x4, &y4);
double x5, y5, x6, y6, x7, y7, x8, y8;
scanf(" (""%lf"", ""%lf"")" ", ""(""%lf"", ""%lf"")" ", ""(""%lf"", ""%lf""
)" ", ""(""%lf"", ""%lf"")" , &x5, &y5 , &x6, &y6, &x7, &y7, &x8, &y8);
完全不懂原理==
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.140.208.46 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1665116301.A.A1A.html
推 hduek153: 寫這什麼鬼10/07 12:19
※ 編輯: sustainer123 (223.140.208.46 臺灣), 10/07/2022 12:20:12
推 koy784512: 好醜 10/07 12:20
→ sustainer123: 我也不知道 反正能把那串數字輸入進去惹 10/07 12:20
→ Jaka: 我從來不這樣寫 10/07 12:21
→ Jaka: 我寫的話 我會整段讀入 然後用split取得個別我要的資料 10/07 12:22
→ dannyko: 笑死 什麼咒文 10/07 12:22
→ dannyko: 你很棒 但是永遠不要當我同事 10/07 12:22
推 koy784512: 初學者這樣寫蠻正常的 10/07 12:23
→ sustainer123: 我漬鯊 10/07 12:23
推 twosheep0603: 我的天 好久沒看到這種等級的code了 10/07 12:23
→ sustainer123: split還沒教 我查一下 10/07 12:23
推 abcd991276: 罷拖 用一下struct 包裝一下 10/07 12:24
推 lturtsamuel: 寶 我吐了 10/07 12:24
→ dannyko: Split 是Python Java JS才有的 你不要亂跟人家走寶貝 10/07 12:25
→ sustainer123: 對不起 10/07 12:25
→ sustainer123: struct也還沒教QQ 10/07 12:26
→ sustainer123: 好QQ 10/07 12:26
→ koy784512: 我大一學C的時候struct很後面才教 10/07 12:26
推 Jaka: 純C的話 就用strtok啊 10/07 12:27
→ sustainer123: 沒教QQ 我等等研究一下 10/07 12:30
推 kerycheng: 土法煉鋼 10/07 12:30
推
推
→
→
→
→
→
推
→
推
→
推
推
推
→
→
→
→
→
推
→
推