程序有个部分读不懂,#include void main(){int x,y,t;double a;float b;in
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 16:05:56
程序有个部分读不懂,
#include
void main()
{
int x,y,t;
double a;
float b;
int c;
scanf("%d %d",&x,&y);
c=b=a=20/3;
t=(x%y,x/y);
printf("%d %d\n",x--,--y);
printf("%d\n",t);
printf("%d\n",(x=5*6,x*4,x+5));
printf("%f %f %f\n",c,b,a);
}
中的t=(x%y,x/y)和printf("%d\n",(x=5*6,x*4,x+5));
#include
void main()
{
int x,y,t;
double a;
float b;
int c;
scanf("%d %d",&x,&y);
c=b=a=20/3;
t=(x%y,x/y);
printf("%d %d\n",x--,--y);
printf("%d\n",t);
printf("%d\n",(x=5*6,x*4,x+5));
printf("%f %f %f\n",c,b,a);
}
中的t=(x%y,x/y)和printf("%d\n",(x=5*6,x*4,x+5));
这两个都是逗号表达式的简单使用
逗号表达式的值为最后一个表达式的值.
所以t=(x%y,x/y)表示t的值为x/y
printf("%d\n",(x=5*6,x*4,x+5)); 表示要打印x+5的值,而x+5前面有两个表达式要先执行
x=5*6 所以 x=30
x*4 不会改变x的值
所以最后x+5=35,打印出35
逗号表达式的值为最后一个表达式的值.
所以t=(x%y,x/y)表示t的值为x/y
printf("%d\n",(x=5*6,x*4,x+5)); 表示要打印x+5的值,而x+5前面有两个表达式要先执行
x=5*6 所以 x=30
x*4 不会改变x的值
所以最后x+5=35,打印出35
程序有个部分读不懂,#include void main(){int x,y,t;double a;float b;in
#include #include int main(void) { float a,b,c,x,y,z; printf
#include void main() { int a,b; float x,y; char c1,c2; scanf
有关C语言公式问题#include #include void main (){int r,h;double a,b,c
这个程序语法的错误 #include void main(){int x ,y ;char x='A';int y='A
#include double s(double x); void main() { double a,y; scanf
# include void main( ) { int a,b,c,sum; float aver; scanf("%
填空题,括号内#include #include #include void main(){ int x,y,t,max
#include void main () { int x,y,z,a,b,c,d,g,f; scanf("%d+%d"
#include #include void main( ){float a,b,max,x;printf("Pleas
高手帮我做下,101、有以下程序#include void main(){ int a=1,b=2,c=3,t;t=c;
#include Int main(void ) { int a = 5,b = 4,x,y; x = 2 * a++