单项选择题

有以下程序 int a=4; int f(int n) {int t=0;static int a=5; if(n%2){int a=6;t+=a++;} else{int a=7;t+=a++;} return t+a++; } main() {int S=a,i=0; for(;i<2;i++)S+=f(i); prinff("%d\n",s); } 程序运行后的输出结果是【 】。

A.24
B.28
C.32
D.36
<上一题 目录 下一题>
热门 试题

单项选择题
第48~50题基于以下信息。以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请从与下划线处号码对应的一组选若中选择出正确的选项。#include stuct node{ char data; struct node *next;};(48) CreatList(char *s){ struct node *h,*p,*q);h=(struct node *)malloc(sizeof(struct node));p=q=h;while(*s!=’’ 0’’){ p=(struct node *)malloc(sizeof(struct node));p->data= (49) ;q->next=p;q= (50) ; s++;}p->next=’’ 0’’;return h;}main( ){ char str[ ]= link list ;struct node *head;head=CreatList(str);...}
A.char *
B.struct node
C.struct node*
D.char
单项选择题
有以下程序:main( )int f1 (int x, int y){ return x>yx:y; }int f2 (int x, int y){ return x>yy:x; }main( ){ int a=4,b=3,c=5,d,e,f;d=f1(a,b); d=f1(d,c);e=f2(a,b); e=f2(e,c);f=a+b+c-d-e;printf( %d,%d,%d n ,d,f,e);}执行后输出的结果是( )。
A. 3,4,5
B. 5,3,4
C. 5,4,3
D. 3,5,4
相关试题
  • 有以下程序:void swapl(int c0[],i...
  • 下面程序的功能是输出以下形式的金字塔图案...
  • 有以下程序:struct STU{ char num[1...