您好,欢迎来到尚车旅游网。
搜索
您的当前位置:首页第四套 上机考试模拟试题

第四套 上机考试模拟试题

来源:尚车旅游网
第四套 上机考试模拟试题

1、程序填空题:

# include # include # include # define M 60 void fun(char *t) {

int j,m=strlen(t)-1; char s;

for(j=0;jchar b[M];

printf(\"Input a string:\"); gets(b);

printf(\"The original string is:\"); puts(b); fun(b); printf(\"\\n\");

printf(\"The reversal string :\"); puts(b); }

2、程序改错题:

# include # include # include /*******error*********/ void fun(char s,char c) {

while(*s && *s!=c) s++;

/*******error*********/ if(*s=='c')

{ s[0]=c;

/*******error*********/ s[1]='0'; } } main() {

char str[81],ch;

printf(\"\\n Please enter a string:\\n\"); gets(str);

printf(\"\\n Please enter the character to search:\"); ch=getchar(); fun(str,ch);

printf(\"\\nThe result is %s\\n\}

3、程序设计题:

# include # include # define M 3 # define N 4 int fun(int b[M][N]) { } main() {

int a[M][N]={{3,5,7,9},{9,9,9,4},{9,9,9,8}};

int i,j,sum; FILE *out;

printf(\"The original data is : \\n\"); for(i=0;ifor(j=0;jsum=fun(a);

printf(\"\\nThe sum: %d\\n\ printf(\"\\n\");

out=fopen(\"outfile.dat\ fprintf(out,\"%d\ fclose(out); }

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- sceh.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务