Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の入力をscanfに読み込みたい:
10 0 y 2 2, 80, 40, 0
これは、別のファイルから scanf で準備する必要があります。
次のようにするだけで、コンマなしで最初の 2 行を取得できます。
scanf("%d %d %c %d", a1, a2, a3, c1, a4);
コンマで区切られた 3 行目を読み取って変数に格納するにはどうすればよいでしょうか?