天涯明月刀剑荡八荒mv:求任一实数的绝对值?用C语言编写?谢谢

来源:百度文库 编辑:中科新闻网 时间:2024/05/09 19:31: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();
}