如下程序运行后如果输入5,a ,那么运行结果是_____def main(): a,b=eval(input()) try: s=a/b print(s) except: print("Divide 0!") main()A.程序出错B.5C.aD.Divide 0!

如下程序运行后如果输入5,a ,那么运行结果是_____def main(): a,b=eval(input()) try: s=a/b print(s) except: print("Divide 0!") main()

A.程序出错

B.5

C.a

D.Divide 0!


参考答案和解析
AAABBB

相关考题:

若有如下程序:public class Test {public static void main (String[] args) {int x=20;if (x>10) System.out.print(x-=5);if (x>5) System.out.print(x--);}}则程序运行后的输出结果是【 】。

下列程序的运行结果是public class test{private String[] data={“10”,“10.5”};public void fun(){double s=0;for(int i=0;i3;i++){try{s=s+Integer .parseInt(data[i]);}catch(Exception e){System.out.print(“errorl:”+data[i]);}}}public static void main(String[]args){try{testd=new test();d .fun();}catch(Exception e){System.out.printIn(“error2”);}}}A.errorl:10.5B.error2C.errorl:10.5 error2D.以上都不对

有如下程序,运行输出的结果是 ______ 。 s=0 Do s=(s+1)*(s+2) n=n+1 Loop Until s>=30 Print n; sA.0 1B.30 30C.4 30D.3 182

( 19 )阅读下列代码public class Test2005{public static void main(String args[]){String s= ″ Test ″ ;Switch(s){case ″ Java ″ : System.out.print( ″ Java ″ ) ;break ;case ″ Language ″ : System.out.print( ″ Language ″ ) ;break ;case ″ Test ″ : System.out.print( ″ Test ″ ) ;break ;}}}其运行结果是A ) JavaB ) LanguageC ) TestD )编译出错

以下程序运行后的输出结果是【】。includemain(){int k=1,s=0; do{ if((k%2)!=0)continue; 以下程序运行后的输出结果是【 】。include<stdio.h>main(){ int k=1,s=0;do{if((k%2)!=0) continue;s+=k; k++;}while(k>10);printf("s+%d\n",s);}

下面的程序的运行结果是__________type Slice []intfunc NewSlice() Slice {return make(Slice, 0)}func (s* Slice) Add(elem int) *Slice {*s = append(*s, elem)fmt.Print(elem)return s}func main() { s := NewSlice()defer s.Add(1).Add(2)s.Add(3)}

下面的程序的运行结果是__________func main() { x := []string{"a", "b", "c"}for _, v := range x { fmt.Print(v)}}

有以下程序:include main ( ){ inti=0.s=0;for(;;) if( i = = 3 ‖ i = = 5 ) continu 有以下程序: #include <stdio. h> main ( ) { inti=0.s=0; for(;;) if( i = = 3 ‖ i = = 5 ) continue; if (i ==6) break; i++; s+ =i; } printf(" % d \n" ,s);程序运行后的输出结果是( )。A.10B.13C.21D.程序进入列循环

有以下程序: main() { int x[8]={8,7,6,5,0,0},*s; s=x+3; printf("%d\n",s[2]); } 程序运行后的输出结果是______。A.随机值B.0C.5D.6

有以下程序 int a=3; main() { int s=0; { int a=5;s+=a++;} s+=a++; printf("%d\n",s); } 程序运行后的输出结果是______。A.8B.10C.7D.11

有如下程序段struct abc{ int a, b, c, s;};main(){ struct abc s[2]={{1,2,3},{4,5,6}}; int t; t=s[0].a+s[1].b; printf("%d\n",t);}程序运行后输出的结果是A.5 B.6 C.7 D.8

下面程序的运行结果是( )。include main(){int a=25; fun(A); }fun(int *x){ print 下面程序的运行结果是( )。include<stdio.h>main(){int a=25;fun(A);}fun(int *x){ printf("%d\n",++*x);}

有以下程序 int a=3; main() {int s=0; { int a=5;s+=a++;} 8+=a++;printf(“%d\n”,s); } 程序运行后的输出结果是A.8B.10C.7D.11

以下程序运行后,输出结果是______。includess(char*s){char *p=s; while(*.p)p++; retu 以下程序运行后,输出结果是______。#include<stdio.h>ss (char *s){ char *p=s; while(*.p)p++; return(p-s);}main(){ char *a="abded"; int i; i=ss((A); print ("%d\n",i);}A.8B.7C.6D.5

有以下程序 int f (int A) { return a%2; } main ( ) { int s[8]={1,3,5,2,4,6),i,d=0; for (i=0; f(s[i]; i++) d +=s[i]; print f ("%d\n", D) ; } 程序运行后的输出结果是A.9B.11C.19D.21

有以下程序: #includestdio.h main( ) {int a=2,b=2,C=2; print{("%d\n",a/bc); } 程序运行后的输出结果是( )。A.0B.1C.2D.3

下列程序运行后的输出结果是 ______。 include void main(){ int s=0,k for(k=7;k>=0 下列程序运行后的输出结果是 ______。include<iostream.h>void main(){int s=0,kfor(k=7;k>=0;k--){switch(k){case 1:case 4:case 7:s+ +;break:case 2:case 3:case 6:break;case 0:case 5:s+=2;break;}

下面程序的运行结果是( )。 include main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m 下面程序的运行结果是( )。 include<stdio.h> main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m<=4){n=n*a;s=s+n;++m;} printf("s=%d",s); }

阅读下列代码 public class Test { public static void main(String args[]) { String s = "Test"; switch (s) { case "Java": System.out.print("Java"); break; case "Language": System.out.print("Language"); break; case "Test": System.out.print("Test"); break; } } } 其运行结果是( )。A.JavaB.LanguageC.TestD.编译出错

有如下程序: include using namespace std; class TestClass { private: int x,y; pu 有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。A.print1B.print2C.print1 print2D.程序编译时出错

有以下程序:include using namespace std;class sample{private: int x; static int 有以下程序:#include <iostream>using namespace std;class sample{private: int x; static int y;public: sample(int a); static void print(sample s);};sample:: sample(int a){ x=a; y+=x;}void sample:: print(sample s){ cout<<"x="<<s. x<<",y="<<y<<end1;}int sample:: y=0;int main(){ sample s1(10); sample s2(20); sample:: print(s2); return 0;}程序运行后的输出结果是( )。A.x=10,y=20B.x=20,y=30C.x=30,y=20D.x=30,y=30

假定n=3,,下列程序的运行结果是()。includeint Fun(int m)void main(){cout 假定n=3,,下列程序的运行结果是( )。 #include<iostream.h> int Fun(int m) void main() { cout<<"Please input a number:"; int n,s=0; cin>>n; s=Fun(n); cout<<s<<endl; } int Fun(int m) { iht p=1,s=0; for (int I=1;I<=m;I++) { p*=I; S+=p; } return s; }A.7B.9C.8D.10

以下程序运行后的输出结果是【】。 include void main(){char s[]=“123456”,*p;for(p=s 以下程序运行后的输出结果是【 】。include<iostream.h>void main(){char s[]=“123456”,*p;for(p=s; p<s+2; p++)cout<<p<<end1;}

有以下程序: #include stdio.h main( ) { int a=7; while(a--); print[("%d\n",a); } 程序运行后的输出结果是( )。A.-lB.0C.1D.7

有以下程序 int a=2; int f(int n) { static int a=3; int t=0; if(n%2) {static int a=4; t+=a++;} else {static int a=5; t+=a++;} return t+a++; } main ( ) { int s=a, i; for (i=0;i<3; i++) s+=f (i) print f ("%d\n" , s ); } 程序运行后的输出结果是A.26B.28C.29D.24

单选题有以下程序:#include #define F(x) 2.84+x#define PR(a) printf(%d,(int)(a))#define PRINT(a) PR(a);putchar('')main(){ PRINT(F(5)*2);}程序运行后的输出结果是(  )。A12B13C15D11

单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是(  )。A****,4B****,13CTHIS,4DTHIS,13

单选题有如下程序:#include main(){ char name[10] = {'S','T','R','I','N','G'}; name[3]='E'; name[5]=0; printf(%s,name);}程序运行后的输出结果是(  )。ASTRENGBSTRIEGCSTRENDSTREN0