#include iostream
#include cmath
using std::cout;
using std::cin;
using std::sqrt;
int main(){
const double fish_factor=2.0/0.5;
const double pi_=3.14159265;
double fish_count=0.0;
double fish_length=0.0;
cout\"Enter the number of fish you want to keep:\";
cinfish_count;
cout\"Enter the average fish length in inches:\";
cinfish_length;
fish_length=fish_length/inches_per_foot;
<pre id=\"best-answer-content\" class=\"reply-text mb10\">代码有很多错的地方,这是修正的~可能有的地方不是按你的要求来的:
#include iostream
#include cmath
using std::cout;
using std::cin;
using std::sqrt;
int main(){
const double fish_factor=2.0/0.5;
const double pi=3.14159265;//之前,这里pi多连了一个_,与后面引用时不符
double fish_count=0.0;
double fish_length=0.0;
double inches_per_foot;//这个是我加的,你在后面用到了,可是之前没有定义~
cout\"Enter the number of fish you want to keep:\";
cinfish_count;
cout\"Enter the average fish length in inches:\";
cinfish_length;
cout\"Enter inches_per_foot:\";//这一句和下一句都是我加的,因为后面用到了
cininches_per_foot;
fish_length=fish_length/inches_per_foot;//使用变量前必须先赋值~