[单选题]

下列函数的运行结果是 include int f(int a,int b) { int c; if(a>b) c=1; else i

下列函数的运行结果是

#include<iostream.h>

int f(int a,int b)

{ int c;

if(a>b) c=1;

else if(a==b) c=0;

else c=-1;

return(c) ;}

void main( )

{ int i=2,j=3;

int p=f(i, j) ;

cout < < p;}

A.-1

B.1

C.2

D.编译出错,无法运行

参考答案与解析:

相关试题

下列函数的运行结果是 #include int f(int a,int b) {