首页 > 计算机等级考试
题目内容 (请给出正确答案)
[判断题]

在语句int*p;和语句printf("%d",*p);中的*p含义相同。()

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“在语句int*p;和语句printf("%d",*p);中的…”相关的问题
第1题
若有定义和语句:int**pp,*p,a=20,b=10;pp=&p;p=&a;p=&b;printf("%d,%d\n",*p,**pp);则输出结果是()。

A.20,10

B.20,20

C.10,20

D.10,10

点击查看答案
第2题
若有定义:int x=0, *p=&x;, 则语句 printf("%d\n",*p);的输出结果是()。A.随机值B.0C.x 的地

若有定义:int x=0, *p=&x;, 则语句 printf("%d\n",*p);的输出结果是()。

A.随机值

B.0

C.x 的地址

D.p的地址

点击查看答案
第3题
若有定义: int a=0, *p=&a;则语句printf ("%d\n", *p) ;输出的结果()

A.随机数

B.0

C.的地址

D.p的地址

点击查看答案
第4题
设有定义语句 int x[6]={2,4,6,8,5,7},*p=x,i; 要求依次输出x数组6个元素中的值,不能完成此操作
的语句是______。

A.for(i=0;i<6;i++) printf("%2d",*(p++));

B.for(i=0;i<6;i++) printf("%2d",*(p+i));

C.for(i=0;i<6;i++) printf("%2d",*p++);

D.for(i=0;i<6;i++) printf("%2d",(*p)++);

点击查看答案
第5题
若有定义int x=0,*p=&x;,则语句printf("%d\n",*p);的输出结果是 ______。

A.随机值

B.0

C.x的地址

D.p的地址

点击查看答案
第6题
有以下程序段int n,*p=NULL;*p=&n;printf("输入 n:"); scanf("%d",&p);printf("输出 n:"); printf("%d/n",p);该程序段试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是()。

A.scanf("%d",&p);

B.printf("%d/n",p);

C.*p=&n;

D.int n,*p=NULL;

点击查看答案
第7题
有以下程序#includemain(){intn,*p=NULL;*p=&n;printf(“Inputn:”);scanf(“%d”,&p

有以下程序 #include main() {int n,*p=NULL; *p=&n; printf(“Input n:”); scanf(“%d”,&p); printf(“output n:”); printf(“%d\\n”,p); }

该程序试图通过指针p为变量n读入数据并输出,但程序有多处错误,以下语句正确的是()。

A.int n,*p=NULL;

B.*p=&n;

C.scanf(“%d”, &p)

D.printf(“%d\n”,p);

点击查看答案
第8题
请编写函数fun(),它的功能是:移动一维数组中的内容,若数组中有n个整数,要求把下标从0到p(含p,p<n

请编写函数fun(),它的功能是:移动一维数组中的内容,若数组中有n个整数,要求把下标从0到p(含p,p<n-1)的数组元素平移到数组的最后。例如:一维数组中的原始内容为:1,2,3,4,5,6,7,8,9,10;p的值为3。移动后,一维数组中的内容应为: 5,6,7,8,9,10,1,2,3,4。部分源程序在文件PROG1.C中。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入你编写的若干语句。

include<stdiO.h>

define N 80

void fun(int *w,int p,int n)

{

}

main()

{in[ a[N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

int i,p,n=15;

printf("The odginal data:\n");

for(i=0;i<n;i++)printf("%3d",a[i]);

printf("\nEnter p:");

scanf("%d",&p);

fun(a,p,n);

printf ("\n The data after moving:\n");

for(i=0;i<n;i++)printf("%3d”,a[i]);

}

点击查看答案
第9题
请补充函数fun(),该函数的功能是:从‘a’到‘z’统计一个字符串中所有字母字符各自出现的次数,结果保

请补充函数fun(),该函数的功能是:从‘a’到‘z’统计一个字符串中所有字母字符各自出现的次数,结果保存在数组aIf中。注意:不区分大小写,不能使用字符串库函数。

例如,输入: “A=abc+5*c”,结果为:a=2, b=l,c=2。

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

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

试题程序:

include<conio.h>

include<stdio.h>

define N 100

void fun(char *tt,int alf[])

{

int i

char *p=tt;

for(i=0;i<26;i++)

【 】;

while(*p)

{

if(*p>='A'&&*p<='z')

【 】;

if(*p>='a'&&*p<='Z')

alf[*p-'a']++;

【 】;

}

}

main()

{

char str[N];

char a='a';

int alf[26],k;

clrscr();

printf("\nPlease enter a char string:");

scanf("%S",str);

printf("\n**The original string**\n");

puts(str);

fun(str,alf);

printf("\n**The number of letter**\n");

for(k:0;k<26;k++)

{

if(k%5==0)

printf(“\n”);

printf(“%c=%d”,a+k,alf[k]);

}

printf(“\n”);

}

点击查看答案
第10题
请编写函数fun(),该函数的功能是:移动一维数组中的内容,若数组中有n个整数,要求把下标从0到p(p≤n

请编写函数fun(),该函数的功能是:移动一维数组中的内容,若数组中有n个整数,要求把下标从0到p(p≤n-1)的数组元素平移到数组的最后。

例如,一维数组中的原始内容为1,2,3,4,5,6,7, 8,9,10,11,12,13,14,15,p的值为3。移动后,一维数组中的内容应为5,6,7,8,9,10,11,12,13,14,15, 1, 2, 3, 4。

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

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

试题程序:

include <stdio.h>

define N 80

void fun(int *w, int p, int n)

{

}

main ()

{

int a[N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

int i, p, n=15;

printf("The original data:\n");

for(i=0;i<n;i++)

printf("%3d",a[i]);

printf("\n\nEnter p: ");

scanf("%d",&p);

fun(a,p,n);

printf("\nThe data after moving:\n");

for(i=0;i<n;i++)

printf("%3d",a[i]);

printf("\n\n");

}

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