出力について(続き2)

Kazunori Kamiya
Aug 9, 2017 · 2 min read

・Exercise9:出力の続き2

引き続き、出力について学習していきます。
最初のうちはコードが理解できないかもしれませんが、後ほど理解できるようになるはずです。
まずはひたすら、コードを書いて実行してみてください。

出力結果について

以下のようになります。

この出力結果から、”\n”を挿入すると開業して出力できることがわかります。
最後の方で用いている”%q”は、シングルクォート’と同じ役割を果たし、ここれを使うと図のように4行欲しければ4行出力、5行や6行出力したければそれだけ書けば可能になります。

学習ドリル

  1. それぞれの行の上に、それが何を意味するのかコメントを入れてください。

学習ドリルの答え

  1. 以下のようになります。

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade