从眼神判断男人喜欢你:求任一实数的绝对值?用C语言编写?谢谢

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 14:56:15

#include <stdio.h>
#include <math.h>

void main(){
float f;
scanf("%f",&f);
printf("|%f|=%f",f,fabs(f));
}

main()
{float f;
scanf("%f",&f);
if(f<0)f=-f;
printf("%d",f);}

#include<stdio.h>
#include <math.h>
#include <conio.h>
void main()
{
float a;
printf("Please Input the number:");
scanf("%f",&a);
printf("|%f|=%f",a,fabs(a));
getche();
}