/*
*copyright(c)2017,优快云学院
*All rights reserved.
*文件名称: main.c
*作 者: 杨隆胜
*完成日期: 2017年8月5日
*版 本 号: v1.0
*
*问题描述:编程序,计算下面函数的值并输出(x取整型即可)

*输入描述:输入x;
*程序输出:输出y;
*/
#include <stdio.h>
int main()
{
int x,y;
printf("Please input the integer argument x:\n");
scanf("%d",&x);
if(x>=1)
{
y=x-1;
}
else
{
y=-x+1;
}
printf("The value of the funtion that caculating is %d\n",y);
return 0;
}
运行结果
心得体会
在编程过程中如果出现中文字符,对同一错误,编译器将会报错两次。好像在课程中老师有讲过,但是记不得了 ,果然是好脑不如 烂笔头。