欢迎来到天天文库
浏览记录
ID:42090224
大小:138.50 KB
页数:5页
时间:2019-09-07
《嘉院C语言上机试题10》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#includemain(){inta[20]={9,3,0,4,1,2,5,6,8,10,7},n=11;inti,j,p,t;printf("Beforesorting%dnumbers:",n);j=0;for(i=1;i<=n;i++,j++){printf("%4d",a[j]);if(!(i%10))printf("");}printf("");for(j=0;j2、************/for(i=j+1;ia[i])/************found************/t=i;if(p!=j){t=a[j];a[j]=a[p];a[p]=t;}}printf("Aftersorting%dnumbers:",n);j=0;for(i=1;i<=n;i++,j++){printf("%4d",a[j]);if(!(i%10))printf("");}printf("");}#includema3、in(){inti,a[10];for(i=1;i<=10;i++)/**************found************/___(1)___;for(i=0;i<5;i++)/**************found************/___(2)___;for(i=0;i<10;i++)printf("%5d",a[i]);printf("");}#include"stdio.h"#include"math.h"#include"conio.h"#include"stdlib.h"void4、NONO(intk);main(){inti,j,count=0;/***********begin***********//************end************/printf("count=%d",count);NONO(count);}voidNONO(intk){FILE*f;f=fopen("out1.dat","w");fprintf(f,"count=%d",k);fclose(f);}
2、************/for(i=j+1;ia[i])/************found************/t=i;if(p!=j){t=a[j];a[j]=a[p];a[p]=t;}}printf("Aftersorting%dnumbers:",n);j=0;for(i=1;i<=n;i++,j++){printf("%4d",a[j]);if(!(i%10))printf("");}printf("");}#includema
3、in(){inti,a[10];for(i=1;i<=10;i++)/**************found************/___(1)___;for(i=0;i<5;i++)/**************found************/___(2)___;for(i=0;i<10;i++)printf("%5d",a[i]);printf("");}#include"stdio.h"#include"math.h"#include"conio.h"#include"stdlib.h"void
4、NONO(intk);main(){inti,j,count=0;/***********begin***********//************end************/printf("count=%d",count);NONO(count);}voidNONO(intk){FILE*f;f=fopen("out1.dat","w");fprintf(f,"count=%d",k);fclose(f);}
此文档下载收益归作者所有