运行以下程序,输出结果为()。lst1=['abc','def','ghi'] lst2=[i[::-1
第1题
以下程序的输出结果为()。s="AB123def" for i in s: print(i,end='') #本次输出后不换行,后面的内容紧接着输出 if i.islower(): #字符串的islower方法用于判断字符串中的字母是否全为小写字母 print('yes') break else: print('no')
第2题
A.编译失败
B.编译通过,没有结果输出
C.输出:除法正常运行
D.输出:除数不能为0
第3题
当用户输入为3时,以下程序的运行结果为()。 n=int(input("请输入一个整数:")) s=0 for i in range(-1,n): s=s+i print(s)
第4题
A.range(0,len(s),2)
B.range(1,len(s),2)
C.range(1,-1,2)
D.range(0,-1,-2)
第6题
以下程序运行结果的第十行为()。 for i in "abc": for j in range(1,11): print("{}{}".format(i,j))
第7题
class A
{
int a;
A(int b)
{a=b;}
void show()
{System.out.println(“a=”+a);}
}
public class Class1
{
public static void main (String args[])
{
A bj=new A(12345);
boolean b=false;
char ch=97;
obj.show();
System.out.println(“b=”+b+”/tch=”+ch);
}
}
第8题
A.9
B.5
C.6
D.6.1
第9题
和它们类型的大小是一致的。而4个形式参数i,j,f,e的地址间隔和它们类型的大小不一致,试分析不一致的原因。
运行结果为:
第10题
阅读下列程序,请输出程序结果:
longfac(intn)
longf;
if(n<0)cout<<"n<0"<
elseif(n==0)f=1;
elsef=fac(n-1)*n;
returnf;
}
voidmain()
longfac(intn);
intn=5;
longy;
y=fac(n);
cout<
第11题
请写出下列程序的输出结果。()
#include
int main() /{
char str[ ]="1A2B3C4D"; int i;
for(i=0;str[i]!='/0';i++)
if ((str[i]<'0') || (str[i]>'9'))
printf("%c",str[i]);
return 0;
/}
}