zoj 1241.Geometry Made Simple
2012-10-16 18:08
309 查看
Geometry Made Simple
#include <iostream> #include <cmath> using namespace std; int main(int argc, char* argv[]) { // ifstream cin("aaa.txt"); int a,b,c,n; n=0; cout.precision(3);//有效数字三位 while(cin>>a>>b>>c) { if(a==0&&b==0&&c==0)break; n++; if(a==-1) { if(c*c-b*b<=0) { cout<<"Triangle #"<<n<<endl; cout<<"Impossible."<<endl; cout<<endl;//产生空行 } else { cout<<"Triangle #"<<n<<endl; //定点输出 cout<<"a = "<<fixed<<pow(c*c-b*b,.5)<<endl; cout<<endl;//产生空行 } } else if(b==-1) { if(c*c-a*a<=0) { cout<<"Triangle #"<<n<<endl; cout<<"Impossible."<<endl; cout<<endl;//产生空行 } else { cout<<"Triangle #"<<n<<endl; //定点输出 cout<<"b = "<<fixed<<pow(c*c-a*a,.5)<<endl; cout<<endl;//产生空行 } } else if(c==-1) { cout<<"Triangle #"<<n<<endl; //定点输出 cout<<"c = "<<fixed<<pow(a*a+b*b,.5)<<endl; cout<<endl;//产生空行 } } return 0; }
相关文章推荐
- ZOJ Problem Set - 1241 Geometry Made Simple
- zoj 1241 Geometry Made Simple
- ZOJ 1241: Geometry Made Simple
- ZOJ Problem Set - 1241 Geometry Made Simple
- ZOJ Problem Set–1241 Geometry Made Simple
- zoj 1241 Geometry Made Simple
- ZOJ Problem Set - 1241 Geometry Made Simple
- ZOJ 1241: Geometry Made Simple 【输出有效数字】
- zoj 1241 Geometry Made Simple
- ZOJ 1241 Geometry Made Simple
- zoj 1241 Geometry Made Simple
- ZOJ 1241 Geometry Made Simple
- ZOJ 1241 Geometry Made Simple
- ZOJ 1241 Geometry Made Simple
- ZOJ 1241 Geometry Made Simple
- ZOJ_1241_Geometry Made Simple
- zoj_1241 Geometry Made Simple
- 1241 Geometry Made Simple
- zju1241简化几何计算Geometry Made Simple
- 1241_Geometry Made Simple