Input format:
Floating-point
The output format:
Sign: - or +
Integral part:
A decimal fraction part: to 3 decimal places
There will be someone there?
CodePudding user response:
#includeusing namespace std;
Int main ()
{
Float a;
cin> a;
Char s;
if(a> 0)
S='+'.
The else
{
S='-';
A=- a;
}
//two lines under the compiler will give you the warning of "may lose data", no need to worry, if really don't want to see a warning and a strong turn (int)
Int I=a;
Int d=1000 * (a - I);
Cout & lt; <"The sign:" & lt;
return 0;
}