首页 > 高职专科
题目内容 (请给出正确答案)
[主观题]

有下列程序: include<stdio_h> deftneN5 defineMN+1 definefix)(x*M) main() {inti1,i

有下列程序: include<stdio_h> deftneN5 defineMN+1 definefix)(x*M) main() {inti1,i2; i1=f(2); i2=f(1+1); printf(%d%d\n,il,i2); } 程序的运行结果是

A.127

B.1212

C.1111

D.117

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有下列程序: include<stdio_h> deftne…”相关的问题
第1题
有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3;intt=0;if(n%2){ stat

有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。

A.26

B.28

C.29

D.24

点击查看答案
第2题
以下程序运行后的输出结果是【 】。 include <stdio, h> main() char c1 ,c2; for(e

以下程序运行后的输出结果是【 】。 include <stdio, h> main() char c1 ,c2; for(el = 0, c2 =9; e1<c2; c1 + + , c2 -- ) printf(" %c%c", c1, c2 ); printf("\n" ); }

点击查看答案
第3题
下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。#include "stdio

下面程序的功能是将小写字母变成对应大写字母后的第二个字母。其中y变成A,z变成B。

#include "stdio.h"

main()

{char c;

while((c=getchar())!='\n')

{if(c>='a'&&c<='z')

c=c-30;

if(c>'z'||c<='z'+2)

c=c-26;}

printf("%c",c);

}

错误:______

改正:______

参考答案:错误

点击查看答案
第4题
以下程序从终端读入数据到数组中,统计其中正数的个数,并计算它们之和,请填空。 include <s
tdio, h> main() int i, a [20], sum, count; sum = count = 0 ; for(i=0;i<20;i++)scanf("%d",【 】); for(i=0;i<20;i ++) {if(a[i] >0) { count + +; sum+ = 【 】; } prinff("sum = % d, count = % d \ n", sum, count ); }

点击查看答案
第5题
以下程序的功能是:给r输入数据后计算半径为r的圆面积s。#include <stdio, h>main()/* Beginning */{ int r; float s; scanf("% d", &r); s = *Π* r*r;printf("s =%f",s); 程序在编译时出错,出错的原因是

A.注释语句书写位置错误

B.存放圆半径的变量r不应该定义为整型

C.输出语句中格式描述符非法

D.计算圆面积的赋值语句中使用了非法变量

点击查看答案
第6题
请编写函数fun(),其功能是:将s所指字符串中下标为偶数的字符删除,串中剩余字符形成的新串放在t所

请编写函数fun(),其功能是:将s所指字符串中下标为偶数的字符删除,串中剩余字符形成的新串放在t所指数组中。

例如,当s所指字符串中的内容为ABCDEFGHIJK,则在t所指数组中的内容应是BDFHJ。

注意:部分源程序给出如下。

请勿改动主函数main口其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。

试题程序:

include<conio. h>

include<stdio .h>

include<string.h>

void fun(char *s,char t[])

{

}

main ()

char s[l00] ,t[l00];

clrscr ();

printf("%nPlease enter string S: ");

scanf("%s ",s);

fun(s,t);

prlntf("\nThe result is:%s\n ",t);

}

点击查看答案
第7题
请补充main函数,该函数的功能是:打印届1~1000中满足:个位数字的立方等于其本身所有数。 本题的结

请补充main函数,该函数的功能是:打印届1~1000中满足:个位数字的立方等于其本身所有数。

本题的结果为;1 64 125 216 729

注意:部分源程序给出如下。

请勿改动主函数main和其他函数中的任何内容,仅在函数main的横线上填入所编写的若干表达式或语句。

试题程序:

include <stdio .h>

main ()

{

int i,g;

clrscr ();

for (i=1; i<1000; i++)

{

g=【 】;

if(【 】)

printf ("%4d", i);

}

}

点击查看答案
第8题
下列程序的字符串中各单词之间有一个空格,则程序的输出结果是______。 include <string.h>
main() { char strl[]="How do you do", *p1=strl strcpy(strl+strlen(strl)/2,"es she"): printf("%s\n",p1): }

点击查看答案
第9题
下列程序中字符串中各单词之间有一个空格,则程序的输出结果是【 】。 include<string.h> m
ain() { char str1[]="How do you do",*p1=str1; strcpy(str1+strlen(str1)/2,"es he"); printf("%s\n",p1); }

点击查看答案
第10题
有以下程序()

A.#include

B.02356

C.0235

D.235

E.2356

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改