网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下面程序的输出结果是 price = {"杂酱面":10,"牛肉面":15,"水饺":10,"抄手":10} sold = {"杂酱面":10,"牛肉面":10,"混沌":5,"抄手":5} total = 0 for name in price.keys(): total += price.get(name,0) * sold.get(name,0) print(total)


参考答案和解析
无输出
更多 “下面程序的输出结果是 price = {"杂酱面":10,"牛肉面":15,"水饺":10,"抄手":10} sold = {"杂酱面":10,"牛肉面":10,"混沌":5,"抄手":5} total = 0 for name in price.keys(): total += price.get(name,0) * sold.get(name,0) print(total)” 相关考题
考题 在窗体上添加一个命令按钮控件,名为Command1,事件过程如下,则执行结果是 Option Base 1 Private Sub Command1_Click() Dim a(5)As Integer Dim k As Integer Dim total As Integer a(1) = 2 a(2) = 5 a(3) = 4 a(4) = 10 a(5) = 6 For k = 1 To 5 Total = total + a(k) Next k Print total End SubA. 10 B.15 C. 27 D. 35

考题 如下程序的输出结果是______。 include using namespace std; class pumpkin{ publ 如下程序的输出结果是______。include<iostream>using namespace std;class pumpkin{public:pumpkin( ){++count;}~pumpkin( ){--eount;}static void total_count( ){cout<<count<<"pumpkin(s)"<<endl;}private:static int count;};int pumpkin::count=0;int main( ){pumpkin pl[10];pumpkin::total_count( );return 0;}

考题 执行下面程序输出的是【】。 include using namespace std;template T tot 执行下面程序输出的是【 】。include <iostream>using namespace std;template <typename T>T total(T *data){Ts=0;while( *data) s+=*data++;return s;}int main(){int s[]={1,3,5,7,0,2,4,6,8};cout<<total(s);return 0;}

考题 有如下程序段,该程序段执行完后,执行循环的次数是total=0Counter=1DoPrint Countertotal=total + CounterPrint totalCounter=Counter + 1If total 10 ThenExit DoEnd IfLoop While Counter =10( )。A.5B.10C.15D.20

考题 下面程序的输出结果是()。includemain(){int a[]={1,2,3,4,5,6,7,8,7,10},*p;p=a;print 下面程序的输出结果是( )。 #include<stdio.h> main() {int a[]={1,2,3,4,5,6,7,8,7,10},*p; p=a; printf("%d\n",*p+8); }A.0B.1C.10D.9

考题 c++,运行下面代码出错 #include iostreamusing namespace std;struct student_info{ string name; int chinese; int math; int english;};student_info student[5];void inputinfo(){ int i = 0; char a[20]; for(i = 0;i 5;i++) { cout"enter the "i+1" student's information "endl; cout"enter the name"endl; cina; student[i].name = a; cout"enter chinese performance :"endl; cinstudent[i].chinese; cout"enter math performance :"endl; cinstudent[i].math; cout"enter english performance :"endl; cinstudent[i].english; }}void outputinfo(){ int i = 0; while(i 5) { couti+1" student's information"endl; coutstudent[i].name.c_str()endl; cout"chinese "endl; coutstudent[i].chineseendl; cout"math "endl; coutstudent[i].mathendl; cout"english "endl; coutstudent[i].englishendl; i++; }}int avgfunction(int arr[],int n){ int i = 0; int total = 0; for(i = 0;i n;i++) { total += arr[i]; } return total / n;}void computavg() //这里是否正确?{ int theavg = 0; theavg = avgfunction(student[i].chinese,5); }int main(){ inputinfo(); outputinfo(); computavg(); cin.get(); return 0;} 帮我找出错误 然后改过来 择优为满意答案 不分先后

考题 有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 下列程序的输出结果是【】 includeusing namespace std; template T total 下列程序的输出结果是【 】include<iOStream>using namespace std;template <typename T>T total (T*datA){T s=0;while(*datA){s+=*data++;}return s;}int main(){int x[]={2,4,6,8,0,12,14,16,18};cout<<total(x)<<end1;return 0;}

考题 下列程序的执行结果是( )。 Privaae Sub Form_Activate Dim score(3)As Integer,total As Integer Dim aa_score As Variant score(1)=50:score(2)=14:score(3)=36 total=0:i=0 For Each aa_score In score i=i+1 total=total+aa_score Print i,aa_score,total Next End SubA.1 0 0 2 50 50 3 14 64 4 36 100B.1 50 50 2 14 64 3 36 100C.0 50 50 1 14 64 2 36 100 3 36 100D.0 0 0 1 50 50 2 14 64

考题 有如下程序: include using namespace std; class pumpkin{ public:pumpkin(){++count 有如下程序:include<iostream>using namespace std;class pumpkin{public:pumpkin(){++count;}~pumpkin(){--count;}static void total_count(){cout<<count<<"pumpkin(s)"<<end1;}private:static int count;};int pumpkin::count=0;int main(){pumpkin p1[10];pumpkin::total_count();return 0;}这个程序的输出结果是______。

考题 有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 有如下程序: include using namespace std; class Pet{ char name[10]; public: Pet(c 有如下程序:include<iostream>using namespace std;class Pet{char name[10];public:Pet(char*name){strcpy(this->name,name);}const char*getName()const {return name;}virtual void call()const=0;};class Dog:public Pet{public:Dog(char*name):Pet(name){}void call()const{cout<<"汪汪叫":}};class Cat:public Pet{public:Cat(char*name):Pet(name){}void call()const{cout<<"喵喵叫";}};int main(){Pet*pet1=new Dog("哈克"),*pet2=new Cat("吉米");cout<<pet1->getName();pet1->call();cout<<end1;cout<<pet2->getName();pet2->call();cout<<end1;return 0;}程序的输出结果是______。

考题 有如下的程序段,该程序段执行完后,共执行的循环次数是 total=0 Counter=1 Do Print Counter total=total * Counter + 1 Print total Counter=Counter +1 If total > 10 Then Exit Do End If Loop While Counter<=10A.4B.10C.15D.20

考题 有如下程序段,该程序段执行完后,执行循环的次数是 total=0 Counter=1 Do Print Counter total=total + Counter Print total Counter=Counter+1 If total>10 Then Exit Do End If Loop While Counter <=10A.5B.10C.15D.20

考题 有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click() total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End SubA.5B.10C.12D.20

考题 在一个窗体上添加一命令按钮控件,名为Command1,事件过程如下,则该过程的执行结果是( )。 option base 1 Private Sub Command1_Ctick() Dim a (5) As Integer Dim k As Integer Dim total As Integer a(1)=2 a(2)=5 a(3)=4 a(4)=10 a(5)=6 For k=1 To 5 total=total+a(k) Next k Print total End SubA.10B.15C.27D.35

考题 有如下程序段,该程序段执行完后,共执行循环的次数是 Private Sub Command1_Click( ) Tota1=0 Counter=1 Do Print Counter Tota1=tota1+Counter Print total Counter=Counter+1 If total=10 Then Exit Do End lf Loop While Counter<=10 End SubA.5B.10C.12D.20

考题 有以下程序:includeinclude struct STU {char name[10];int hum;};void f( 有以下程序:#include <stdio.h>#include <strine.h> struct STU { char name[10]; int hum;};void f(char * name,iht num){ struct STU s[2] = {{ "SunDan" ,20044} , {" Penghua" ,20045}}; num= s[0]. nnm; strepy(name,s[0], name);}main( ){ struct STU s[2] = {{"YangSan" ,20041 }, { "LiSiGao" ,20042}}, * P; p = s[1]; f(p->name,p->hum); printf("% s %d \n" ,p-> name,p->num);}程序运行后的输出结果是( )。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041

考题 以下代码的运行结果为:public class Calc {public static void main (String args []) {int total = 0;for (int i = 0, j = 10; total >30; ++i, --j) {System.out.println(" i = " + i + " : j = " + j);total += (i + j);}System.out.println("Total " + total);}}A. 产生运行错误B. 产生编译错误C. 输出 "Total 0"D. 产生如下输出:i = 0 : j = 10i = 1 : j = 9i = 2 : j = 8Total 30

考题 b=10def index():b=5index()print(b)输出结果是()A、10B、5C、0D、程序异常

考题 a=10ifa==10:print(a-10)else:print[a]程序的输出结果是()。A、0B、10C、-10D、程序异常

考题 Which command will allow the creation of a10-character login user name?()A、chlogin -a log_name=10B、chdev -l sys0 -a max_logname=10C、chusr extended_logname=true [userid]D、chuser login_name=10 extended_logname=true [userid]

考题 Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()  A、The rectangle drawn will have a total width of 5 pixels.B、The rectangle drawn will have a total height of 6 pixels.C、The rectangle drawn will have a total width of 10 pixels.D、The rectangle drawn will have a total height of 11 pixels.

考题 单选题若要实现total=1+2+3+4+5求和,以下程序段错误的是(  )。A int i=1,total=1; while(i5) {  total+=i;  i+=1; }B int i=1,total=0; while(i =5) {  total+=i;  i+=1; }C int i=0,total=0; while(i 5) {  i+=1;  total+=i; }D int i=0,total=0; while(i =5) {  total+=i;  i+=1; }

考题 单选题有以下程序: #include main() {  charname[10]={'S','T','R'};  name[2]='#';  name[6]=0;  printf(%s,name); } 程序运行后的输出结果是(  )。A ST#B STR#C STR#0D STR0

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

考题 单选题a=10ifa==10:print(a-10)else:print[a]程序的输出结果是()。A 0B 10C -10D 程序异常

考题 单选题b=10def index():b=5index()print(b)输出结果是()A 10B 5C 0D 程序异常