课程
/后端开发
/C
/C语言入门
我int y,n; 然后直接输入money>=cost?y:n 就是不用字符表示n,y 为啥不行
2019-11-05
源自:C语言入门 3-9
正在回答
你好,你用int定义了y和n,它们就变成整型变量了不是字符了
好的,谢谢
举报
C语言入门视频教程,带你进入编程世界的必修课-C语言
2 回答int char[x][y]={{ },{ },……{ },{ }};
2 回答include <stdio.h> int main() { int x,y; x = 10; y = -3; printf("x+y=%d\n", x+y ); printf("x-y=%d\n", x-y ); printf("x*y=%d\n", x*y ); printf("x/y=%d\n", x/y ); printf("x%y=%d\n", x%y ); return 0;
2 回答#include <stdio.h> int main() { int x,y; x = 10; y = -3; printf("x+y=%d\n", x+y ); printf("x-y=%d\n", x-y ); printf("x*y=%d\n", x*y ); printf("x/y=%d\n", x/y ); printf("x%y=%d\n", x%y ); return 0;
4 回答#include <stdio.h> int main() { int x = 10; int y = 10; x=x*2; y*=2; printf("x=%d\n", x); printf("y=%d\n", y); return 0; }
6 回答#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;}