doublex,y;scanf('%lf%lf',x,y);可以将键入的2030分别赋给x,y变量.
举一反三
- __________________(double,double);main(){doublex,y;scanf("%lf%lf",&x,&y);printf("%lf",max(x,y));}doublemax(doublea,doubleb){return(a>b?a:b);}
- (16)若有定义语句:doublex,y,*px,*py,执行了px=&x,py=&y之后,正确的输入语句是A)scanf(“%f%f”,x,y)B)scanf(“%f%f”,&x,&y)C)scanf(“%lf%le”,px,py)D)scanf(“%lf%lf”,x,y)
- 有如下变量定义: float x; double y; 则给变量x,y输入数据的正确语句是() A: scanf("%f%f",x,y); B: scanf("%f%f",&x,&y); C: scanf("%f%lf",x,y); D: scanf("%f%lf",&x,&y);
- 已定义变量如下 floatx;doubley; 想要从键盘上输入2.5赋给x、3.78赋给y, 以下正确的输入语句是 A: scanf("%f%f",&x,&y); B: scanf("%f%lf",&x,&y); C: scanf("%.1f%.2f",&x,&y); D: scanf("%.1f%.2lf",&x,&y);
- 若有定义语句:double x;float y;不正确的输入语句是() A: scanf(“%lf%f”,x,y); B: scanf(“%f%f”,&x,&y); C: scanf(“%lf%f”,&x,&y); D: scanf(“%f%lf”,&x,&y);