帮我修改一下C++的代码和书写格式

来源:百度知道 编辑:UC知道 时间:2024/05/30 11:08:03
帮忙查下它的问题,帮我修改一下!

#include<iostream>

int main ()
{ double x; cout <<"Enter a temperature:"; cin >>x;
if (x<=-273.125) cout <<"invalid temperature ("
<< x <<" deg. C)."<<endl;
else {
cout << "The temperature is "<<x<< "deg . c . ";
if
(x<=0)
cout << "It's freezing!";
eals if (x>=100) cout << "It's boiling!";
eals
{
}
{
cout << endl;
return o;}

#include <iostream.h>

int main ()
{
double x;
cout <<"Enter a temperature:";
cin >>x;
if (x<=-273.125)
cout <<"invalid temperature ("<< x <<" deg. C)."<<endl;
else
{
cout << "The temperature is "<<x<< "deg . c . ";
if(x<=0)
cout << "It's freezing!";
else if (x>=100)
cout << "It's boiling!";
else
{
cout << endl;
}
}

return 0;
}

int main ()
{
double x;
cout <<"Enter a temperature:";
cin >>x;

if(x<=-273.125)
{
cout <<"invalid temperature ("
<< x <<" deg. C)."<<endl;
}
else
{