#include<iostream> using namespace std; int abs(int x){ if(x>0)return x; return -x; } int main(){ int x;//局部变量 cin>>x; cout<<abs(x);//将函数返回值输出 }