5.计算表达式
x>1
要求计算精度为第n项的绝对值小于10
– 5。
#include
int main()
{ float y,s=1,x,xx=1,a=1,i=1;
scanf( );
do
{ a=-a;
i++;
xx=xx*x;
y=i/xx;
s=s+a*y;
}while(y>0.00001);
printf( );
return 0;
}
第6章 数组
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-8c30-c003-bc7499099f00.html
点击查看答案
35.下列正确的字符串常量是________。
A. 'abc'
B. '\t'
C. "\\t"
D. 97
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-8e90-c003-bc7499099f00.html
点击查看答案
31.下面程序运行后输出结果为________。
#include
int main()
{printf("%d\n", f(21, 35)); return 0;}
int f( )
{ if( ) return m;
else
if( )return f( );
else return f( );
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-d7f0-c003-bc7499099f00.html
点击查看答案
58.下面程序段在编译时不会报错的是( )。
A. #define double 2
B. #define b 2
void main()void main()
{double b=0;}{int b=0;}
C. #define b 2
D. #define b 2
void main()int x=b;
{b++;}void main()
{x++;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-c928-c003-bc7499099f00.html
点击查看答案
7.下面程序运行后输出的结果是________。
#include
int main()
{ int x=10;
while( );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-ccc8-c003-bc7499099f01.html
点击查看答案
29.下面程序运行后输出结果是________。
#include
void fun( )
{ if(n<100)
printf("%d", n/10);
else
{ fun(n/100); printf("%d", n%100/10); }
}
int main()
{ fun(123456); return 0;}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-d020-c003-bc7499099f00.html
点击查看答案
11.A12.C13.C14.B15.C16.C17.B18.A19.C20.C
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-5b80-c003-bc7499099f00.html
点击查看答案
7.已有定义“int a=1;”,则执行“printf("%d", (a+5,a++));”时输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-1360-c003-bc7499099f01.html
点击查看答案
6.已知有声明和语句“int a; scanf( );”,欲从键盘上为变量a输入的值为2,则正确的输入应是________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-f420-c003-bc7499099f01.html
点击查看答案
5.编写程序,输入一个整数,将它逆序输出。要求定义并调用函数reverse( ),它的功能是返回number的逆序数。例如reverse(12345)的返回值是54321。
#include
long reverse( )
{ long m=0,i,a;
i=n%10;
m=i;
n=n/10;
while(n>0)
{ i=n%10;
m=m*10+i;
n=n/10;
}
return m;
}
int main()
{ long n;
printf( );
scanf( );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-79e8-c003-bc7499099f00.html
点击查看答案