1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 沈阳航空航天大学计算机考研真题文件模板

沈阳航空航天大学计算机考研真题文件模板

时间:2021-07-26 13:16:47

相关推荐

沈阳航空航天大学计算机考研真题文件模板

文件获取字符数据模板

#include<stdio.h>#include<stdio.h>int main(){FILE *a,*b,*c;char x[100];int i=0;char temp;if((a=fopen("19.6.a.txt","r"))==NULL){printf("cannot open file");return 0;}if((b=fopen("19.6.b.txt","r"))==NULL){printf("cannot open file");return 0;}while(!feof(a)){temp=fgetc(a);if((temp<='z' & temp >='a') | (temp >= 'A' &temp <= 'Z')){x[i]=temp;i++;}}while(!feof(b)){temp=fgetc(b);if((temp<='z' & temp >='a') | (temp >= 'A' &temp <= 'Z')){x[i]=temp;i++;}}for(int j=0;j<i;j++){for(int m=0;m<i-j-1;m++){if(x[m] > x[m+1]){temp=x[m];x[m]=x[m+1];x[m+1]=temp;}}}if((c=fopen("19.6.c.txt","w")) == NULL){printf("cannot open file");return 0;}//fprintf(c,"%s",x);for(int j=0;j<i;j++){fputc(x[j],c);}return 0;}

21沈航计算机考研已上岸,真题有一些还是有点难度的,当时挺头疼,现在分享出来,算法思路感觉有点啰嗦,欢迎交流

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。