写出下列程序的运行结果【】。 include void func(double x, int part1, double 写出下列程序的运行结果【 】。include<iostream. h>void func(double x, int part1, double part2){part1=int(x)+500:part2=(x+500-part1)*100;}void main( ){int n;double x, f;x=1001. 0103;func (x, n, f):cout<<"Part 1="<<n<<" , part2="<<f<<end1}
写出下列程序的运行结果【】。 include void func(double x, int &part1, double
写出下列程序的运行结果【 】。
include<iostream. h>
void func(double x, int &part1, double &part2){
part1=int(x)+500:
part2=(x+500-part1)*100;
}
void main( ){
int n;
double x, f;
x=1001. 0103;
func (x, n, f):
cout<<"Part 1="<<n<<" , part2="<<f<<end1
}
相关考题:
下列程序的运行结果是()。includevoid fun (int *a,int*b){int*kk=a;a=b;b=k}void 下列程序的运行结果是( )。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=a,*y=b; fun(x, y) ; cout<<a<<" "<<b<<endl:}A.20049B.92004C.0D.编译时出错
下列程序的运行结果是______。includelong func(int x){ long p;if(x==O‖x==1)return(1) 下列程序的运行结果是______。include<stdio.h>long func(int x){ long p;if(x==O‖x==1)return(1);p=x*func(x-1);return(p);}main(){ printf("%d\n",func(4));}
下列程序不能通过编译,应该在划线部分填写的语句是【 】。includeinclude 下列程序不能通过编译,应该在划线部分填写的语句是【 】。include<iostream. h>include<stdlib. hdouble Fune(int a, int b, char ch){double x;switch(ch){case '+':x=double(a) +b;break;case '--':x= double(a) --b;break;case '/':x=double(a) * b;break;case '/':if(B) x=double(a) /b;elseexit(1)breakdefault:exit(1);}______}void main(){cout<<Func(32 , 6 ,'--')<< ",";cout<<Func(32, 6 ,'*') <<",";cout<<Func(32, 6 ,'/') <<end1;}
阅读下面程序:include template class TAdd{private:T x, y;public:TAdd(T 阅读下面程序:include <iostream.h>template <class T>class TAdd{private:T x, y;public:TAdd(T a, T b){x=a;y=b;}T add(){return x +y;}};void main( ){TAdd<int>a(5,6);TAdd<double>b(2.4,5.8);cout<<"s1 ="<<A. add()<<",";cout<<"s2="<<B, add()<<end1;}写出该程序的运行结果:【 】。
下列程序的运行结果是______。include int Func(int *a,int n) {int s=1; for(int i=0 下列程序的运行结果是______。include<iomanip.h>int Func(int *a,int n){int s=1;for(int i=0;i<n;i++)s*=*a++;returns;}void main(){inta[]:{1,2,3,4,5,6,7,8};intb=Func(a,6)+Func(a[5],2);cout<<“b=“<(b<<endl;}
下列程序不能通过编译,应该在划线部分填写的语句是______。 include include 下列程序不能通过编译,应该在划线部分填写的语句是______。include<iostream.h>include<stdlib.h>double Func(int a,int b,char ch){double x;switch(ch){case'+':x=double(a)+b;break;case '-':x=double(a)-b;break;case '*':x=double(a)*b;break;case'/':if(B)x=double(a)/b;elseexit(1);break;default:exit(1);}______}void main( ){cout<<Func(32,6,'-')<<",";cout<<Func(32,6, '*')<<",";cout<<Func(32,6,'/')<<endl;}
写出下面程序执行后的运行结果。 #include <stdio.h> #include <math.h> #define ROUND(x,m) ((int)((x)*pow(10,m)+0.5)/pow(10,m)) int main() { printf("%f,%f", ROUND(12.3456,1),ROUND(12.3456,2)); return 0; }
以下程序段运行后的输出结果为_____。 double x=5.16894; printf(“%fn“,(int)(x*10000+0.5)/(double)10000);A.5.169000B.5.175000C.5.168900D.5.168000