- 11
- 0
- 约10.75万字
- 约 14页
- 2017-02-17 发布于河南
- 举报
C作业题及答案
一、分析程序,写输出结果
1. #includeiostream.h
#includemath.h
void main()
{int m, k, i ;
for( m=1; m=10; m+=2 )
{ k = m/3;
for( i=2; i=k; i++ )
if( m%i ) cout m ;
}
}
7 9
2. #includeiostream.h
void fun();
void main()
{int i;
for(i=1;i5;i++) fun();
coutendl;
}
void fun()
{ static int a;
int b=2;
a += 2 ;
cout a+b \t;
}
4 6 8 10
3. #includeiostream.h
int fun(int n)
{ if(n==0) return 1;
return 2*fun(n-1);
}
void main()
{ int a=5;
coutfun(a)endl;
}
32
4. #includeiostream.h
void main()
{ char *cp=word;
for (int i=0 ; i4; i++ )
coutcp+i \t;
}
word ord rd
原创力文档

文档评论(0)