题目:求绝对值
代码:
/*求绝对值*/
#include<stdio.h>
int main()
{
int a=0;
printf("Please enter one number:"); //请输入一个数:
scanf_s("%d", &a);
if (a < 0)
a = -a;
printf("The absolute value is:%d\n", a); //这个数的绝对值是
return 0;
}
运行结果:
2024-03-06 16:10:02
题目:求绝对值
代码:
/*求绝对值*/
#include<stdio.h>
int main()
{
int a=0;
printf("Please enter one number:"); //请输入一个数:
scanf_s("%d", &a);
if (a < 0)
a = -a;
printf("The absolute value is:%d\n", a); //这个数的绝对值是
return 0;
}
运行结果: