网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
有以下程序:includestruct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a

有以下程序: #include<stdio.h> struct tt { int x;struct tt *y;} *p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main() {int i; p=a; for(i=1;i<=2;i++) {printf("%d,",p->x);p=p->y;} } 程序的运行结果是( )。

A.20,30,

B.30,17

C.15,30,

D.20,15,


参考答案

更多 “ 有以下程序:includestruct tt{ int x;struct tt *y;} *p;struct tt a[4]={20,a+1,15,a 有以下程序: #include<stdio.h> struct tt { int x;struct tt *y;} *p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main() {int i; p=a; for(i=1;i<=2;i++) {printf("%d,",p->x);p=p->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30,D.20,15, ” 相关考题
考题 设有以下语句typedef struct TT{char c,int a[4];} CIN;则下面叙述中正确的是A) 可以用 TT 定义结构体变量B)TT 是 struct 类型的变量C) 可以用 CIN 定义结构体变量D)CIN 是 struct TT 类型的变量

考题 设有以下语句 typedef struct TT {char c; int a[4];}CIN; 则下面叙述中正确的是______。A.可以用TT定义结构体变量B.TT是struct类型的变量C.可以用CIN定义结构体变量D.CIN是struct TT类型的变量

考题 以下程序调用函数swap将指针s和t所指单元(a和B)中的内容交换,请填空。 main() {int a=10,b=20,*s,*t; s=a;t=b; ( ) printf("%d%d",a,B); } swap(int*ss,int*tt) {int te; te=*ss; *ss=*tt; *tt=te; }

考题 有以下程序 include struct tt { int x; struct tt *y; } *p; s 有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } *p; struct tt a[4]= {20,a+ 1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1; i<-2; i++) { printf("%d,", p->x ); p=p->y; }A.20,30,B.30,17C.15,30,D.20,15,

考题 有以下程序:includestruct tt{int x;struct tt*y;}*p;struct tt a[4]={20,a+1,15,a+2, 有以下程序: #include<stdio.h> struct tt {int x;struct tt*y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a} main() { int i; p=a; for(i=1;i<=2;i++){printf("%d",p->x);p=P->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30D.20,15

考题 下列给定程序中,函数fun()的作用是,将字符串tt中的大写字母都改为对应的小写字母,其他字符不变。例如,若输入"Ab,cD",则输出"ab, cd"。请改正函数fun()中的错误,使它能得出正确的结果。注童:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <stdio.h>include <string.h>include <conio.h>char *fun (char tt[]){int i;for(i=0; tt[i]; i++)/**************found**************/{ if(('A' <=tt[i]||(tt[i]<='z' ))tt[i]+=32; }return(tt);}main(){int i;char tt[81];clrscr();printf("\nPlease enter a string:");gets(tt);printf("\nThe result string is:\n %s", fun(tt));}

考题 下列给定程序中,函数fun()的作用是:将字符串tt中的小写字母都改为对应的大写字母,其他字符不变。例如,若输入“edS,dAd”,则输出“EDS,DAD”。请改正程序中的错误,使它能得到正确结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <stdio.h>include <string.h>include <conlo.h>/*************found*************/char fun(char tt[ ]){int i;for(i=0;tt[i];i++){/*************found*************/if((tt[i]>='A')(tt[i]<='2'))tt[i]-=32;}return(tt);}main(){int i;char tt[81];clrscr();printf("\nPlease enter a string:");gets(tt);printf("\nThe result string iS:/n%s", fun(tt));}

考题 设有以下语句: typedef struct TT {char c; int a[4];}CIN; 则下面叙述中正确的是( )。A.可以用TT定义结构体变量B.TT是struct类型的变量C.可以用CIN定义结构体变量D.CIN是struct TT类型的变量

考题 有以下程序:includestxucttt{ intx;structtt *y;}*p;struct tta[4]={20,a+1,15,a+2,30 有以下程序: #include <stdio.h> stxuct tt { int x;struct tt *y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1;i<=2;i++) {printf("%d,",p->x ); p=p->y;} } 程序的运行结果是( )。A.20,30,B.30,17C.15,30,D.20,15,