正在加载图片...
24.include<iostream.h> void main(){ int a=1,b=2,c; c=a十b; int b=a+2; c+=a+b; } cout<<c<<endl; } 运行结果: 25.include<iostream.h> void main()( inta[8]={6,19,4,12,20,5,18,25}; int p,s=0; for(p=a;p<a+8;p++) if(*p<10)s+=*p: cout<<s<<endl; } 运行结果: 26.include<iostream.h #include<string.h> struct Worker char name[15];int age;float pay; }; void main() Worker x; strcpy(x.name,"WangRong"); x.age=45;x.pay=3275; cout<<x,name<<’’<<x.age<<’’<<x.pay<<endl; 运行结果: 43124. :1* include<iostream. h> void main () { int a=1 ,b=2 ,c; c=a+b; { int b=a+2; 十=a十b; cout«c«endl; 运行结果: 25. :1* include<iostream. h> void mainO { int a[8]= {6 ,19 ,4,12 ,20,5,18,25}; int 铸p ,s=o; for(p=a; p<a+8;p++) if< * p<10) s+ =铸 cout<<s<<endl; 运行结果: 26. :1* include<iostream. h> :1* include<string. h> struct Worker{ char name[l5]; int age;float pay; void mainO { Worker x; strcpy( x. name ,"WangRong") ; x. age=45; x. pay=3275; cout<< x. name< <罗 age«' '«x. pay«endl; 运行结果 431
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有