重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 计算机类考试> 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

有以下程序:#include<stdio.h>void sort(int a[],int n){int i,j,t; for(i=0;i<n-1;i+=2)for(j=i

有以下程序: #include <stdio.h> void sort(int a[],int n) { int i,j,t; for(i=0;i<n-1;i+=2) for(j=i+2;j<n;j+=2) if(a[i]<a[j]){t=a[i];a[i]=a[j];a[j]=t;} } main() { int aa[10]={1,2,3,4,5,6,7,8,9,10},i; sort(aa,10); for(i=0;i<10;i++) printf("%d.",aa[i]); printf("\n"); } 其输出结果是()。

A.1,2,3,4,5,6,7,8,9,10,

B.10,9,8,7,6,5,4,3,2,1,

C.9,2,7,4,5,6,3,8,1,10,

D.1,10,3,8,5,6,7,4,9,2,

答案
查看答案
网友您好,请在下方输入框内输入要搜索的题目:
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
更多“有以下程序:#include<stdio.h>void sort(int a[],int n){int i,j,t; for(i=0;i<n-1;i+=2)for(j=i”相关的问题

第1题

以下程序的输出结果是 ______。#include<stdio>main(){int a=200;#define a 100printf("%d",a) ;

以下程序的输出结果是 ______。 #include<stdio> main() {int a=200; #define a 100 printf("%d",a) ; #undefa printf("%d",a) ; }

A.200 100

B.100 100

C.100 200

D.200 200

点击查看答案

第2题

以下程序#include "stdio、h"main(){ char *p="ABCDEF",*q;q=p+3;print

以下程序#include "stdio、h"main(){ char *p="ABCDEF",*q;q=p+3;printf("%s/n",q);}的输出结果是()。

点击查看答案

第3题

有以下程序: #include<string.h> #include<iostream.h> void main() { char * p="abcde\0fghjik\0"; cout < < strlen(p) ;} 程序运行后的输出结果是

A.12

B.15

C.6

D.5

点击查看答案

第4题

有以下程序:#include<stdio.h>#include<string.h>#includevoid f(char*s,char*t){char k;k=*s; *

有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。

A.abcdefg

B.gfedcba

C.gbcdefa

D.abedcfg

点击查看答案

第5题

有以下程序: #include<stdio.h> main() { int y=9; for(;y>0;y--) f(y%3==0)printf("%d",--y); } 程序的运行结果是()。

A.741

B.963

C.852

D.875421

点击查看答案

第6题

有以下程序#include<stdio.h>void main(){int a=1,b=0;printf("%d,",b=(a++)+(a++));pfintf("%d\

有以下程序 #include<stdio.h> void main() { int a=1,b=0; printf("%d,",b=(a++)+(a++)); pfintf("%d\n",a+B); } 程序运行后的输出结果是()。

A.4,6

B.2,5

C.3,5

D.2,6

点击查看答案

第7题

有以下程序 #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"ab

有以下程序 #include <stdio.h> main() { FILE *fp1; fp1=fopen("f1.txt","w"); fprintf(fp1,"abc"); fclose(fp1); } 若文本文件f1.txt中原有内容为:good,则运行以上程序后,文件n.txt中的内容为______。

A.goodabc

B.abcd

C.abc

D.abcgood

点击查看答案

第8题

(21 )有以下程序# include (stdio.h >main (){ int a = l ; b = 2 ;for (; a < 8 ; a++ ) { b

(21 )有以下程序

# include (stdio.h >

main ()

{ int a = l ; b = 2 ;

for (; a < 8 ; a++ ) { b+=a ; a+=2 ; }

printf (" %d , %d \ n ", a , b ) ;

}

程序运行后的输出结果是

A ) 9 , 18

B ) 8 , 11

C ) 7 , 11

D ) 10 , 14

点击查看答案

第9题

有以下程序#include<stdio.h>#include<string.h>typedef strtlct{char name[9];char sex;floatsc

有以下程序 #include <stdio.h> #include <string.h> typedef strtlct{ char name[9]; char sex;floatscore[2]; }STU; void f(STU A)

{ STU b={"Zhao",'m',85.0,90.0}; int i; strcpy(a.name,b.name); a.sex=b.sex; for(i=0;i<2;i++) a.score[i]=b

A.Qian,f,95,92

B.Qian,m,85,90

C.Zhao,f,95,92

D.Zhao,m,85,90

点击查看答案

第10题

有以下程序:#include<stdio.h>#define X 5+6main(){int a=2,c;C=X*2:printf("%d",C);}程序运行后

有以下程序: #include<stdio.h> #define X 5+6 main() {int a=2,c; C=X*2: printf("%d",C); } 程序运行后的输出结果是()。

A.17

B.22

C.16

D.11

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝