试题与答案

下列函数的运行结果是( )。#include<iostream.h>int f(i

题型:单项选择题

题目:

下列函数的运行结果是( )。
#include<iostream.h>
int f(int a,int b)
int c;
if(a>b) c=1;
else if(a==b)c=0
elsec=-1;
return(c);
void main()
int i=2,j=3;
int p=f(i,j);
cout<<p:

A.-1

B.1

C.2

D.编译出错,无法运行

答案:

参考答案:A

试题推荐
题型:填空题

在下列各句的空白处填入一个最恰当的单词,使句子意思完整,语法正确。

1.  My pen is broken.  Can you l_______ me your pen?

2.  There are too many cars in front of the cinema.  I can't find a place to p______ my car.

3.  You'd better make a d _______  answer to the questions.  Don't say other things.

4.  Soldiers must obey o_______ If they don't, they will be published.

5.  I w        ___  who cleaned the classroom without telling me.

6.  May I t _______ you to pass me the salt,  please?

7.  The guide l       __    us through the park.

8.  Don't say that to her, or you will o     __     her.  She'll be angry.

9.  There are some c       __    reasons why this information can't be made public.

10.  The teacher is teaching us the s   __      of the human body in the biology lesson.

查看答案
微信公众账号搜索答案