Программа перестает отвечать после ввода диаметра [закрыто]C++

Программы на C++. Форум разработчиков
Ответить Пред. темаСлед. тема
Anonymous
 Программа перестает отвечать после ввода диаметра [закрыто]

Сообщение Anonymous »


I'm working on a program for a class. The prompt is "Write a program that asks the user their name and the diameter or the pizza they want, calculate the area of the pizza using PI to four decimal places (3.1415) but show the area of their Pizza to the user to two decimal places by using setprecision and fixed from chapter 3 on the output." The issue I'm running into is that once the diameter is input by the user, the program no longer responds.

#include #include #include using namespace std; int main() { string firstName; double Diameter, Area; const double Pi = 3.1415; cout > firstName; cout > Diameter; double Radius = Diameter / 2; cout > Area; Area = Pi * Radius * Radius; cout

Источник: https://stackoverflow.com/questions/781 ... r-is-input
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C++»