#include
struct S
{
int a, b;
} data[2]={10, 100, 20, 200};
void main()
{
struct S p=data[1];
printf("%d", ++(p.a));
}
举一反三
- 有以下程序 struct s { intx,y; }data[2]={10,100,20,200}; main() { struct s *p=data; printf('%d',++(p->x)); } 程序运行后的输出结果是( )
- 【单选题】有以下程序 struct s { intx,y; }data[2]={10,100,20,200}; main() { struct s *p=data; printf("%d ",++(p->x)); } 程序运行后的输出结果是() A. 10 B. 11 C. 20 D. 21
- 有以下程序段,输出结果为()。 #include <stdio.h> struct s { int a; char b; double f; }; main() { printf("%d",sizeof(struct s)); }
- 有以下程序#include <stdio.h>struct ball{char color[10];int dim;};int main(){struct ball list[2] = {{"white", 2}, {"yellow", 3}};printf("%s:%d ", (list+1)->color, list->dim);return 0;}程序运行后的输出结果是()
- 以下程序的输出结果为()。#include "stdio.h"struct{int x;char *c;}st[2]={{1,"ab"},{2,"cd"}},*p=st;main(){printf("%c\t",*p->c);printf("%s\n",(++p)->c); }
内容
- 0
有以下程序#include <;stdio.h>;struct tt{int x;struct tt *y;}s[3]={1,0,2,0,3,0};main(){struct tt *p=s+1;p->;y=s;p=p->;y;printf("%d\n",p->;x);}程序运行后的输出结果是 A: 2,3 B: 2,1 C: 1,2 D: 3,1
- 1
有以下程序段,输出结果为()。 #include<stdio.h> main() { int a[10]={11,32,43,25,16,71,24,23,80,44}; int *p=a; int *s,; s=p+2; printf("%d,%d ",*p,*s); }
- 2
【单选题】有以下程序,程序运行以后输出的结果是()。 structS {inta;intb; } data[2] = {10,100,20,200}; main() { structS p = data[1]; printf(“%d ”,++(p.a)); } A. 10 B. 11 C. 20 D. 21
- 3
有以下程序#include <stdio.h>#include <string.h>main(){ char str[ ][20]={“One*World”, “One*Dream!”},*p=str[1];printf(“%d,”,strlen(p));printf(“%s ”,p);}程序运行后的输出结果是()
- 4
程序阅读:运行以下程序的输出结果是______ ,______ 。(6分) #include "stdio.h"void main() { struct SHAPE { struct { int w,h; } in; int len , area; } e; e.in.w=1; e. in.h=2*e.in.w; e.len=2*( e.in.w + e.in.h2); e.area= e.in.w * e.in.h; printf("%d,%d",e.len, e.area); }