//I don't understand why this isn't working
#include <iostream>
using namespace std;
main ()
{
double pizzaDiameter;
int numSlices;
double area;
cout << "Pizza diameter: " ;
cin >> pizzaDiameter;
area = (pizzaDiameter/2.0) * (pizzaDiameter/2.0) * 3.14159;
numSlices = area/14.125;
cout << numSlices << " slices ";
}
当我在myprogramminglab.com上处理这个程序时,它说这是正确的。但是,当我在visual studio中运行时,它表示存在错误。我只是不明白。
答案 0 :(得分:2)