以下程序运行后的输出结果是( )。#include <stdio.h>struct S {int n; int a[20];};void f(struct S *p){ int i,j,t; for(i=0;i<p->n-1;i++) for(j=i+1;j<p->n;j++) if(p->a[i]>p->a[j]) { t=p->a[i]; p->a[i]=p->a[j]; p->a[j]=t; }}int main(){ int i; struct S s={10,{2,3,1,6,8,7,5,4,10,9}}; f(&s); for(i=0;i<s.n;i++) printf(”%d,”,s.a[i]);}
A、10,9,8,7,6,5,4,3,2,1,
B、1,2,3,4,5,6,7,8,9,10,
C、2,3,1,6,8,7,5,4,10,9,
D、10,9,8,7,6,1,2,3,4,5,
发布时间:2024-05-15 21:12:09