-3

私のプログラムを実行すると、次のようにすべての「cout(s)」が 1 行に表示されます。

すべてのカウントを 1 行に

私のプログラムを素敵にするために、それらを行ごとに表示したいのですが! 次のように表示したい:

Circumference of the circle: (This)
Diameter of the circle: (This)
Area of the circle: (This)
4

2 に答える 2

0

endlまたはを使用\n:

cout<<"Circumference of the circle:"<<your_value<<endl;

また

cout<<"Circumference of the circle:"<<your_value<<"\n";
于 2013-10-25T10:11:36.737 に答える
0

改行が必要な場所に改行文字 ( で記述\n) を印刷するだけです。C:

printf("The value: %d\n", value);

または C++ の場合:

cout << "The value: " << value << "\n";
于 2013-10-25T10:09:10.470 に答える