http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=241
格式问题
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<bitset>
using namespace std;
int main()
{
double a , b , c ;
int Case = 0 ;
while( ~scanf( "%lf%lf%lf" , &a , &b , &c ) )
{
if( a == 0 && b == 0 && c == 0 )
break ;
printf( "Triangle #%d\n" , ++Case ) ;
if( c > 0 && ( c <= a || c <= b ) )
{
printf( "Impossible.\n\n" ) ;
continue ;
}
if( a > 0 && b > 0 )
{
double sum = sqrt( a * a + b *b ) ;
printf( "c = %.3lf\n\n" , sum ) ;
continue ;
}
if( c > 0 && b > 0 )
{
double sum = sqrt( c * c - b * b ) ;
printf( "a = %.3lf\n\n" , sum ) ;
continue ;
}
if( c > 0 && a > 0 )
{
double sum = sqrt( c * c - a * a ) ;
printf( "b = %.3lf\n\n" ,sum ) ;
continue ;
}
}
return 0 ;
}