#include <stdio.h> int main() { int a,s,d,f,g; a=x+y; s=x-y; d=x*y;f=x/y;g=x%y;printf("x+y=%d\n", a);printf("x-y=%d\n", s);printf("x*y=%d\n", d ); printf("x/y=%d\n", f);printf("x%y=%d\n", g);return 0;}
我哪里错了?
向各个大神求助~
???
我哪里错了?
向各个大神求助~
???
2019-08-14
#include <stdio.h> int main() { int a,s,d,f,g; int x; printf("input x: \n"); scanf("%d", &x); int y; printf("input y: \n"); scanf("%d", &y); a=x+y; s=x-y; d=x*y; f=x/y; g=x%y; printf("x+y=%d\n", a); printf("x-y=%d\n", s); printf("x*y=%d\n", d); printf("x/y=%d\n", f); printf("x%%y=%d\n", g); return 0; }
x,y没有定义,也没有赋值 #include <stdio.h> int main() { int a,s,d,f,g; int x; printf("input x: \n"); scanf("%d", &x); int y; printf("input y: \n"); scanf("%d", &y); a=x+y; s=x-y; d=x*y; f=x/y; g=x%y; printf("x+y=%d\n", a); printf("x-y=%d\n", s); printf("x*y=%d\n", d); printf("x/y=%d\n", f); printf("x%%y=%d\n", g); return 0;}
举报