下列方法定义中,正确的是()A.int x(int a,b){return (a-b);}B.double x(int a,int b){int w; w=a-b;}C.int x(int a,int b){return a-b;}D.double x(a,b){return b;}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 21:30:06
下列方法定义中,正确的是()A.intx(inta,b){return(a-b);}B.doublex(inta,intb){intw;w=a-b;}C.intx(inta,intb){returna

下列方法定义中,正确的是()A.int x(int a,b){return (a-b);}B.double x(int a,int b){int w; w=a-b;}C.int x(int a,int b){return a-b;}D.double x(a,b){return b;}
下列方法定义中,正确的是()
A.int x(int a,b){return (a-b);}
B.double x(int a,int b){int w; w=a-b;}
C.int x(int a,int b){return a-b;}
D.double x(a,b){return b;}

下列方法定义中,正确的是()A.int x(int a,b){return (a-b);}B.double x(int a,int b){int w; w=a-b;}C.int x(int a,int b){return a-b;}D.double x(a,b){return b;}
正确的是: C

A: (int a,b) 错误, 形参b必须带类型
B: 缺少return 返回类型
D: 同A, 参数a和b都缺少类型