1、一、分析程序,写输出结果1 #include#includevoid main()int m, k, i ;for( m=1; mvoid fun();void main()int i;for(i=1;iint fun(int n) if(n=0) return 1;return 2*fun(n-1);void main() int a=5;coutvoid main() char *cp=“word“;for (int i=0 ; ivoid main() int max;int a10=76,55,95,87,85,83,65,90,77,85;int *p= a ; max=*p;for
2、( ; pmax ) max= *p ; coutvoid main() int n, k=1, s=0, m;for(n=1; n0 ) k*=m%10;s+=m%10;m=m/10 ; if(ks) coutvoid main()double s; int i, n;coutn;s = 0;for (i=1; ip-data;q=p;while( p-data )if(head=NULL) head=p;else q=q-next ; q=p;p=new node ; cinp-data;q-next=NULL;delete p;5以下程序求方程的全部整数解:3x + 2y - 7z =
3、5 ( 0 x, y, z 100 )#includevoid main() int x, y, z ;for( x=0; x=0 for(i = a; i using namespace std;void main()int i, j, k;k = 10;for(i = 1; i using namespace std;class cal public: int add(int x,int y) /加法定义函数 return x+y; int sub(int x,int y) /减法定义函数 return x-y; int mul(int x,int y) /乘法定义函数 return x*
4、y; int div(int x,int y) /除法定义函数 if(y=0) coutxyID; switch (ID) case +: coutvoidmain()Int x100,k,i,n;Double sum=0.0,ave;coutk;for(i=0;ixi;sum+=xi;ave=sum/k;n=0;for(i=0;iave)n+;coutvoid main()int a50,b5,i,j;printf (“请输入 50个数“);for (i=0;i0;i-2)for (j=0;j5;j+)bj=ai%ai-1;for(j=0;j5;j+)for (i=1;i5;i+)printf(“%d“,bi;printf(“n“);