以下文字与答案无关
提示:有些试题内容 显示不完整,文字错误 或者 答案显示错误等问题,这是由于我们在扫描录入过程中 机器识别错误导致,人工逐条矫正总有遗漏,所以恳请 广大网友理解。
double d=84.54;
d++;
Int c=d/2;
选项: A:42
B:编译错误,更改为int c=(int)d/2
C:43
D:编译错误,更改为int c=int(d)/2
return 0;
}
">6.以下程序输出的结果是( )
#include <stdio.h>
int func(int a, int b) {
return (a + b);
}
int main() {
int x = 2, y = 5, z = 8, r;
r = func(func(x, y), z);
printf("%d\n", r);
return 0;
}
int(2)
B:bin(2)
C:int(2,2)
D:hex(2)
func();
printf("MAIN:x=%2d y=%2d n=%2d",x,y,n);
func();
}
void func()
{
static int x=4;
int y=10;
x=x+2;
n=n+10;
y=y+n;
printf("FUNC:x=%2d y=%2d n=%2d",x,y,n);
}
">12.以下程序的运行结果是____________。int n=1;
void main( )
{
static int x=5;
int y;
y=n;
printf("MAIN:x=%2d y=%2d n=%2d",x,y,n);
func();
printf("MAIN:x=%2d y=%2d n=%2d",x,y,n);
func();
}
void func()
{
static int x=4;
int y=10;
x=x+2;
n=n+10;
y=y+n;
printf("FUNC:x=%2d y=%2d n=%2d",x,y,n);
}
import java.util.Scanner;
public class Main {
public static void main(String] args) {
Scanner sc=new Scanner(System.in);
String str=sc.nextLine();
char x]=(2分);
int a=0;
int b=0;
int c=0;
int d=0;
for(int i=0;(2分);i++){
char ch=xi];
if((2分))
a++;
else if((2分))
b++;
else if(ch==' ')
(2分);
else
d++;
}
System.out.println("letters="+a);//输出英文字母个数
System.out.println("digits="+b);//输出数字个数
System.out.println("spaces="+c);//输出空格个数
System.out.println("others="+d);//输出其他字符个数
}
}
}
}
选项: A:错误:方法参数与变量不匹配
B:20 and 40
C:10 and 40
D:10 and 20
">14.以下代码的输出结果为( )。public class Pass{
static int j = 20;
public void amethod(int x){
x = x*2;
j = j*2;
}
public static void main(String args]){
int i = 10;
Pass p = new Pass();
p.amethod(i);
System.out.println(i+" and "+j);
}
}
选项: A:错误:方法参数与变量不匹配
B:20 and 40
C:10 and 40
D:10 and 20
else if( (c-1 >= d)= 1)
printf("%d\n", d+1);
else printf("%d\n", d+2);
}
执行后输出结果是
选项: A:2
B:4
C:编译时出错
D:3
">15.有以下程序main()
{
int a=5,b=4,c=3,d=2;
if(a>b>c)
printf("%d\n", d) ;
else if( (c-1 >= d)= 1)
printf("%d\n", d+1);
else printf("%d\n", d+2);
}
执行后输出结果是
选项: A:2
B:4
C:编译时出错
D:3
}
}
">18.14、请说出下面中【代码】的输出结果
interface Com {
int add(int a,int b);
public static int get(int n){
return n;
}
public default int see(int n){
return n;
}
public default int look(int n){
return n;
}
}
class A implements Com{
public int add(int a,int b) {
return a+b;
}
public int see(int n){
return n+1;
}
}
public class Main {
public static void main(String args]) {
A a = new A();
int m = a.add(12,6);
int n =Com.get(12);
int t = a.see(6);
int q = a.look(6);
System.out.printf("%d:%d:%d:%d",m,n,t,q); //【代码】
}
}