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.
このタイプの入力を処理するための最良の方法について、実際に探し、疑問に思い、ヒントを求める簡単な質問:
word word word word word word word word word word word
これにより、各行の単語数は完全にランダムになり、個々の単語は、リンクされたリストやツリーなどのデータ構造に追加できます。
各行を取得して解析しますか? ゲッター()? 手がかりはありますか?
ここでは、一度に 1 行ずつ読むfgetsのが最良の選択肢のようです。次に、strtokまたは空のスペースで分割するのと同様のものを使用し、結果を反復処理します。
fgets
strtok