求绝对值
AC的代码:
#include<stdio.h>
int main()
{
double s;
while(scanf("%lf",&s)!=EOF)
{
if(s<0)
{
printf("%.2lf\n",-s);
}
else
printf("%.2lf\n",s);
}
return 0;
}
求绝对值
AC的代码:
#include<stdio.h>
int main()
{
double s;
while(scanf("%lf",&s)!=EOF)
{
if(s<0)
{
printf("%.2lf\n",-s);
}
else
printf("%.2lf\n",s);
}
return 0;
}