设有定义:int a,*p=&a;以下scanf语句中能正确为变量a读入数据的是( )。
A.scanf("%d",pa);
B.scanf("%d",a);
C.scanf("%d",&pa);
D.scanf("%d",*pa);
第1题:
有以下结构体说明、变量定义和赋值语句 struct STD { char name[10]; int age; char sex; }s[5],*ps; ps=&s[0]; 则以下scanf函数调用语句中错误引用结构体变量成员的是______。
A.scanf("%s",s[0].name);
B.scanf("%d",&s[0].age);
C.scanf("%c",&(ps->sex));
D.scanf("%d",ps->age);
第2题:
以下scanf函数调用语句中对结构体变量成员的引用不正确的是
struct pupil
{ char name[20];
int age
int sex;
} pup[5],*p;
p=pup;
A.scanf("%s",pup[0].name);
B.scanf("%d",&pup[0].age);
C.scanf("%dT",&(p->sex));
D.scanf("%d",p->age);
第3题:
有以下程序
#include <stdio.h>
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);
第4题:
若说明int *p,n;则通过语句scanf能够正确读入数据的程序段是
A.p=&n;scanf("%d",&p);
B.p=&n;scanf("%d",*p);
C.scanf("%d",n);
D.p=&n;scanf("%d",p);
第5题:
有以下结构体说明,变量定义和赋值语句: struct STD {char name[10]; int age; char ***; }s[5],*ps; ps=&s[0]; 则以下scanf函数调用语句中错误的结构体变量成员是( )。
A.scanf("%s",s[0].name);
B.scanf("%d",&s[0].age);
C.scanf("%c",&(ps->***));
D.scanf("%d",ps->age);
第6题:
有以下程序 #include <stdio.h> 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);
第7题:
有以下程序: #inlucde<stdio.h> main()D)2 3 3 {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题:
设有定义:
struct person
{ int ID;char name[12];}p;
请将 scanf("%d", 【 1 2 】 ); 语句补充完整,使其能够为结构体变量 p 的成员 ID 正确读入数据。
第9题:
设有如下定义 struct ss { char name[10]; int age; char sex; } std[3],* p=std; 下面各输入语句中错误的是
A.scanf("%d",&(*p).age);
B.scanf("%s",&std.name);
C.scanf("%c",&std[0].sex);
D.scanf("%c",&(p->sex));
第10题:
设有定义:double x[lO],*p=x;,以下能给数组x下标为6的元素读人数据的正确语句是
A.scanf(“%f”,&x[6]);
B.scanf(“%If”,*(x+6));
C.scanf(“%lf”,p+6);
D.scanf(“%lf”,p[6]);