第1个回答 2007-06-24
#include"stdio.h"
int fabs1(int x)
{
if(x<0)return -x;
else return x;
}
main()
{
int n;
scanf("%d",&n);
printf("%d",fabs1(n));
}本回答被提问者采纳
第2个回答 2007-06-24
#include<stdio.h>
void fab(int temp)
{(temp>0)?printf("%d",temp):printf("%d",-temp);}
void main()
{
printf("enter the number:");
int temp=0;
scanf("%d",&temp);
fab(temp);
}