#include<stdio.h> int main() { int a, x, y; printf("请输入x的值:"); scanf("%d", &x); if (x <= 0) a = -1; else a = 1; printf("y=%d", a); return 0; }