有以下程序#include [stdio.h] void sub(double a,double *pb); int main(){ double x,y; scanf("%lf%lf",&x,&y); sub(x,&y); printf("x=%fy=%f\n",x,y); } void sub(double a,double *pb){ a=a-*pb; *pb=*pb-a; }程序运行时输入: 10.2 3.5[回车],则输出结果为( )。
A: x=10.200000 y=-3.200000
B: x=6.700000 y=-13.700000
C: x=7.000000 y=-3.500000
D: x=13.400000 y=-7.000000
A: x=10.200000 y=-3.200000
B: x=6.700000 y=-13.700000
C: x=7.000000 y=-3.500000
D: x=13.400000 y=-7.000000
举一反三
- 以下程序输出结果是( ) #include void sub ( double x,double *y ,double *z) {*y =*y -1.0;*z= *z +x;} main () {double a= 2.5, b= 9.0,*pa, *pb; pa= &a; pb =&b; sub ( b-a, pa,pa ); printf ("%f\n", a); } A: 9.000000 B: 1.500000 C: 8.000000 D: 10.500000
- 若有以下程序: #include<stdio.h> void sub(double x, double*y, double*z) { *y=*y-1.0; *z=*z+x; } main() {double a=2.5, b=9.0, *pa, *pb; pa=&a; pb=&b; sub(b-a, pa, pa); printf("%f\n", a); } 程序的输出结果是 A: 9.000000 B: 1.500000 C: 8.000000 D: 10.500000
- 若有以下程序:#include <stdio.h>void sub (double x, double *y, double *z){ *y=*y-1.0; *z=*z+x; }main( ){ double a=2.5, b=9.0, *pa, *pb; pa=&a; pb=&b; sub ( b-a, pa, pa); printf(“%f\n”, a);}程序的输出结果是 A: 9.000000 B: 1.500000 C: 8.000000 D: 10.500000
- ) void main() { double x,y; scanf('%lf%lf',
- __________________(double,double);main(){doublex,y;scanf("%lf%lf",&x,&y);printf("%lf",max(x,y));}doublemax(doublea,doubleb){return(a>b?a:b);}