- 1、本文档共90页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2012二级C言上机真题题库
二级C语言上机考试复习资料
(共0套题目)第1套
1、程序填空题 #include void fun char *s, int *t int i, n; n 0;
/**********found**********/ for i 0; ___1___ ! 0; i++
/**********found**********/ if s[i] 0s[i] ___2___ n++;
/**********found**********/ ___3___ ; main char s[80] abcdef35adgh3kjsdf7; int t; printf \nThe original string is : %s\n,s ; fun s,t ; printf \nThe result is : %d\n,t ; 2、程序修改题
#include
int fun int *x,int y int t ;
/**************found**************/
t x ; x y ;
/**************found**************/
return y ; main int a 3, b 8 ;
printf %d %d\n, a, b ;
b fun a, b ;
printf %d %d\n, a, b ; 3、程序设计题
#include
void fun int *a, int *n main int aa[1000], n, k ; fun aa, n ; for k 0 ; k n ; k++ if k + 1 % 10 0 printf \n ; else printf %5d, aa[k] ; 第2套
1、程序填空题 #include void fun char *s, char *p int i, j, n, x, t; n 0; for i 0; s[i]! \0; i++ n++; for i 1; i n-2; i i+2 /**********found**********/ ___1___;
/**********found**********/ for j ___2___+2 ; j n; j j+2 if s[t] s[j] t j; if t! i x s[i]; s[i] s[t]; s[t] x; for i 1,j 0; i n; i i+2, j++ p[j] s[i];
/**********found**********/ p[j] ___3___; main char s[80] baawrskjghzlicda, p[50]; printf \nThe original string is : %s\n,s ; fun s,p ; printf \nThe result is : %s\n,p ; 2、程序修改题
#include
#include
float fun float num int s ; float n, t, pi ; t 1 ; pi 0 ; n 1 ; s 1 ;
/**************found**************/ while t num pi pi + t ; n n + 2 ; s -s ;
/**************found**************/ t s % n ; pi pi * 4 ; return pi ; main float n1, n2 ; printf Enter a float number: ; scanf %f, n1 ; n2 fun n1 ; printf %6.4f\n, n2 ; 3、程序设计题
#include
#include
#define LEN 20
void fun char a[], char b[], int n main char str1[LEN], str2[LEN] ; int n ; printf Enter the string:\n ; gets str1 ; printf Enter the index of the char deleted: ; scanf %d, n ; fun str1, str2, n ; printf The new string is: %s\n, str2 ; 第3套
1、程序填空题 #include #include #define N 5
文档评论(0)