c语言程序填空改错题,C语言模拟改错填空编程题.doc
C语言模拟改错填空编程题.doc
下载提示(请认真阅读)1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
2.下载的文档,不会出现我们的网址水印。
3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
文档包含非法信息?点此举报后获取现金奖励!
下载文档到电脑,查找使用更方便
14.9
积分
还剩页未读,继续阅读
关 键 词:改错填空编程题
改错题填空题
C语言模拟 改错填空编程题
C语言程序改错
填空题.doc
改错填空编程
c语言程序改错题
资源描述:
一.
1.
#include #include void main()
{
float a[3],s,area;
int i;
printf("Please input 3 numbers:\n");
for(i=0; i<3; i++)
scanf("%f",/**/ a[i] /**/);
/**/ if( a[0]+a[1]>a[2] || a[1]+a[2]>a[0] || a[0]+a[2]>a[1] ) /**/
{
s = (a[0]+a[1]+a[2])/2;
area = sqrt(s*(s-a[0])*(s-a[1])*(s-a[2]));
printf("area is %.2f\n",area);
}
else
printf("error.\n");
getch();
}
2.
#include #include /**/ void fun() /**/
{
int large,middle,small,n=0;
clrscr();
for( large=0;large<=33;large++ )
for( middle=0;middle<=50;middle++ )
{
small = 2*(100-3*large-2*middle);
/**/ if( large+middle+small=100 ) /**/
{
n++;
printf("%d-->large:%d,middle:%d,small:%d\n",n,large,middle,small);
}
}
return n;
}
void main()
{
int num;
num = fun();
printf("\n There are %d solutions.\n",num);
getch();
}
填空题
1.
#include #include main()
{
int i,/**/ /**/;
int a[4][4],sum;
sum=/**/ /**/;
printf("Please input 16 numbers:\n");
for(i=0; i<4;i++)
for(j=0;j<4;j++)
scanf("%d",&a[i][j]);
for(i=0;i<4;i++)
/**/ /**/
printf("%d\n",sum);
getch();
}
2.
#include int fun(int a[],int n,/**/ /**/)
{
int left,right,mid;
left= 0 ;
right = n-1;
while(left <= right)
{ mid= /**/ /**/;
if( q < a[mid] ) right = mid-1;
else if( q > a[mid]) left = mid+1;
else return mid;
}
return -1;
}
main()
{ int a[]={3,4,6,11,17,22,31,45};
int k,n;
n = sizeof(a)/sizeof(int);
k = fun(a,n,31);
printf("%d\n",k);
getch();
}
3.
#include #include int fun(/**/ /**/,float x,float y)
{
int bIn;
bIn = /**/ /**/ < r ;
return bIn;
}
main()
{
float r=-1,x,y;
int bIn;
while(r<0)
{ printf("Please input radius r (r>0):\n");
scanf("%f", &r);
}
printf("Please input the dot(x,y):\n");
scanf("%f%f",&x,&y);
bIn = fun(r,x,y);
if(bIn == 1)
printf("in the circle!\n");
else
printf("out of the Circle!\n");
getch();
}
1.
#include #include double f(float x)
{
/**/
/**/
}
void main()
{ float x;
double y;
printf("Please input a number:\n");
scanf("%f",&x);
y = f(x);
printf("f(%.3f)=%.3f\n",x,y);
getch();
}
2.
#include #include void f(char p[][20],int n);
void main()
{
int i;
char p[][20]={"abc","xabdfg","abbd","dcdbe","cd"};
f(p,5);
clrscr();
for(i=0;i<5;i++)
printf("%s\n",p[i]);
getch();
}
void f(char p[][20],int n)
{
/**/
/**/
}
二
1.
#include #include main()
{
/**/ char str1 /**/;
int i,len, sum=0;
printf("Please input a string:\n");
scanf("%s", str1);
len = strlen(str1);
for(i=0; i= 'A' && str1[i] <= 'Z')
/**/ sum--; /**/
}
printf("%d\n",sum);
getch();
}
2.
#include #include /**/ #include M 5 /**/
main()
{
int a[M],i;
printf("Please input 5 numbers:\n");
for(i=0; ivoid main()
{
int t=0,/**/ /**/,i;
for(i=1;i<=N;i++)
{
t=/**/ /**/;
s+=t;
}
clrscr();
printf("\ns=%d\n",s);
getch();
}
3.
#includelong fib(int n);
void main()
{
int k;
clrscr();
printf("The first 15 data of Fibonacci is:\n\n");
for(k=1;k<=15;k++)
printf("%d ",fib(k));
printf("\n");
getch();
}
long fib(int n)
{
if(n==1||n==2)
/**/ /**/
else
return /**/ /**/;
}
编程题
1.
#include #include double f(float x)
{
/**/
/**/
}
void main()
{
float x;
double y;
printf("Please input a number: \n");
scanf("%f",&x);
y = f(x);
printf("f(%0.2f)=%0.2f\n",x,y);
getch();
}
2.
#include #include float fun(float a,char flag,float b)
{
/**/
/**/
}
void main()
{
float a,b;
printf("Please input two numbers:\n");
scanf("%f%f",&a,&b);
printf("%.2f+%.2f=%.2f\n",a,b,fun(a,'+',b));
printf("%.2f-%.2f=%.2f\n",a,b,fun(a,'-',b));
printf("%.2f*%.2f=%.2f\n",a,b,fun(a,'*',b));
printf("%.2f/%.2f=%.2f\n",a,b,fun(a,'/',b));
getch();
}
三
1.
#include void main()
{
/**/ int i; j; /**/
for (i=1;i<=5;i++)
{
for (j=1;j<=10-2*i;j++) printf(" ");
/**/ for (j=1;j<=5;j++) /**/
printf("* ");
printf("\n");
}
}
2.
#include #include /**/int fun();/**/
{ int hen,cock,chicken,n=0;
clrscr();
for(cock=0;cock<=50;cock+=1)
for(hen=0;hen<=100;hen=hen+1)
{ chicken=2*(100-hen-2*cock);
/**/ if(cock+hen+chicken=100) /**/
{ n++;
printf("%d-->hen:%d,cock:%d,chicken:%d\n",n,hen,cock,chicken);
if(n==20) getch();
}
}
return n;
}
void main()
{ int num;
num=fun();
printf("\n There are %d solutions.\n",num);
getch();
}
1.
#include/**/ /**/
double fun(double x)
{
/**/ /**/
}
void main()
{
double x,y1,y2;
clrscr();
printf("Please input x:");
scanf("%lf",&x);
y1=fun(x+8);
y2=fun(/**/ /**/);
printf("\nf(x+8)=%.3lf",y1);
printf("\nf(sinx)=%.3lf",y2);
getch();
}
2.
#includedouble fun(unsigned m,unsigned n)
{
unsigned i;
double p=1.0;
for(i=1;i<=m;i++)
/**/ /**/
for(i=1;i<=n;i++)
/**/ /**/
for(i=1;i<=m-n;i++)
p=p/i;
return p; }
void main()
{
clrscr();
printf("p=%f\n",fun(13,7));
getch();
}
3.
#includeint findmax(int* array,int size);
void main()
{
int a[]={33,91,23,45,56,-12,32,12,5,90};
clrscr();
printf("The max is %d\n",/**/ /**/);
getch();
}
int findmax(int *array,int size)
{
int i, /**/ /**/;
for(i=1; imax) max=array[i];
return max;
}
1.
#include #include double f(float x)
{
/**/
/**/
}
void main()
{
float x;
double y;
printf("Please input a number: \n");
scanf("%f",&x);
y = f(x);
printf("f(%.3f)=%.3f\n",x,y);
getch();
}
2.
#include #include void fun(int a[],int m)
{
/**/
/**/
}
void main()
{
int a[20],i;
fun(a,20);
for(i=0; i<20; i++)
printf("%d ",a[i]);
printf("\n");
getch();
}
四
1.
#include #include #include #include void main()
{ char str1[100], t[200];
int i, j;
/**/ i = 0; /**/
clrscr();
strcpy(str1, "4AZ18c?Ge9a0z!");
for (i = 0; i#include #include #include #define M 50
double fun(int n)
{ double y = 0.0;
int i,j;
j=0;
for(i=1;;i++)
{
/**/ if((i<10)&&(i%3==0)) /**/
{
/**/ y+=1/i; /**/
j++;
}
if(j==n) break;
}
return y;
}
void main()
{ clrscr();
printf("fun(8) = %8.3lf\n", fun(8));
}
1.
#include main()
{ int x;
printf("Please input a number:\n");
scanf("%d",/**/ /**/);
printf("%d*%d=%d\n", x,x,/**/ /**/);
getch();
}
2.
#include #include void sort(int a[], int m)
{ int i, j, k, t;
for( i = 0; i < m-1; i++ )
{ k = i;
for( j=i+1; j< /**/ /**/; j++)
if( a[j] < a[k] ) /**/ /**/;
if( k != i )
{ t = a[k];
a[k]= a[i];
a[i] = /**/ /**/;
}
}
}
void main()
{
int a[] = {72,25,58,32,2,15,7,64};
int i,m = sizeof(a)/sizeof(int);
sort(a,m);
for(i=0;i#include /**/ /**/ fun(float a,float b,float c)
{
float s,area ;
s = /**/ /**/;
s = s*(s-a)*(s-b)*(s-c);
if( s < 0 )
area = -1;
else
area = sqrt(s);
return area ;
}
main()
{
float a,b,c,area;
printf("Please input three numbers:\t");
scanf("%f%f%f", &a,&b,&c );
area = fun(a,b,c);
printf("Area is: %.2f\n",area);
getch();
}
1.
#include #include double f(float x)
{
/**/
/**/
}
void main()
{
float x;
double y;
printf("Please input a number:\n");
scanf("%f",&x);
y = f(x);
printf("f(%.3f)=%.3f\n",x,y);
getch();
}
2.
#include #include void f(char p[][20],int n);
void main()
{
int i;
char p[][20]={"abc","xabdfg","abbd","dcdbe","cd"};
f(p,5);
clrscr();
for(i=0;i<5;i++)
printf("%s\n",p[i]);
getch();
}
void f(char p[][20],int n)
{
/**/
/**/
}
展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:C语言模拟改错填空编程题.doc
链接地址:https://www.renrendoc.com/p-15777073.html
c语言程序填空改错题,C语言模拟改错填空编程题.doc相关推荐
- c语言编写程序判断图的连通,图论期末大作业编程题(如何判断一个4连通4正则图为无爪、无K4图)...
博士期间估计这可能是唯一一个要编程的作业,搞了半天弄出这个东西,放这里为以后用到的时候查找方便. 说来也是可笑,读博士期间发现大家对上课也都没什么兴趣,老师也是那么回事,都说博士期间学的课程是要有助于 ...
- 机械工业c语言教程pdf,新编C语言程序计教程(机械工业出版社 钱雪忠 吕莹楠).doc...
新编C语言程序计教程(机械工业出版社 钱雪忠 吕莹楠) PAGE \* MERGEFORMAT33 新编C语言程序设计教程 习题及实验题部分答案 第1章 C 语言概述 1 习题 一.选择题 ADCDB ...
- c语言程序的书写格式,C语言程序书写格式辅导
C语言程序书写格式辅导 C语言具有语句简洁的特点,C语言程序的可读性比较差.因此,为了增强C语言的可读性,正确的书写格式就显得十分重要.同样一个程序采用不同的书写方法.尽管都可以得到相同的结果,有的书 ...
- 两复数乘积C语言,C语言程序(两复数矩阵相乘)改错求助
C语言程序(两复数矩阵相乘)改错求助 哪位高手帮我修改一下下面这段程序的错误,我看了实在是改不出.急用...先谢谢了! double bucmul(double ar,double ai,double ...
- 大学c语言程序上机考试试题,C语言上机试题100套
目包含3道题:一道程序填空题.一道程序修改题.一道程序设计题),真实考试的时候,考生输入准考证后计算机随机为你抽取一套考试,每个考生考试时只需考一套题目(包含三道题),但由于考试时是随机抽题,所以即使 ...
- C语言程序设计基础实验教程,C语言程序设计基础实验教程
本书是教育科学"十五"国家规划课题的研究成果,是<C语言程序设计基础>一书的实验配套教程,它为C语言初学者上机实验提供指导.全书提供了13个方面的验证性.设计性实验,对 ...
- c语言程序中注释定义,C语言语法基础:函数注释等等
任何语言的入门大部分都是从Hello World开始的,我们学习到C语言也不例外.现在很多人说C语言很难,建议Java或者是Python入门.四喜想说的是,万事开头难,如果以C语言入门,之后的其他语言 ...
- c语言程序实习心得体会,c语言实习心得体会
学习c语言不能停留在学习它的语法规则,而是利用学到的知识编写c语言程序,解决实际问题.下面是学习啦带来的c语言实习的心得体会,仅供参考. 一周的C语言实训,虽然时间略显仓促,但却让我学到了很多实际运用 ...
- c语言程序报告样例,C语言个人实习报告定稿(样例3)
<C语言个人实习报告.doc>由会员分享,可免费在线阅读全文,更多与<C语言个人实习报告[定稿]>相关文档资源请在帮帮文库(www.woc88.com)数亿文档库存里搜索. 1 ...
- c语言程序头文件作用,C语言头文件
C语言头文件教程 C 语言的头文件一般都是 .h 做为结尾的. C语言头文件详解 语法 #include 参数 参数 描述 filename 我们需要引入的头文件的名称. 说明 C 语言的头文件一般都 ...
最新文章
- 如果每个人都是一个粒子…… | 从物理学中寻找社会规律
- TeX下的Markdown包
- 每天一道LeetCode-----使用最少的操作将一个字符串转换成另一个字符串,只有插入,删除,替换三种操作
- 牛客 - 骚区间(线段树+思维)
- 填涂颜色(洛谷-P1162)
- 计算机系统结构循环间相关,计算机系统结构(双语)
- Intel 64/x86_64/IA-32/x86处理器 - SIMD指令集 - SSE扩展(12) - 预取指令与SFENCE指令
- tooltip 提示多行显示
- RedHat 安装 CentOS yum
- 用python爬取网页数据代码_python实现web页面数据抓取代码
- 大数据未来七大发展方向 01.物联网
- web前端开发培训学院,前端校招面试题及解析大全,值得收藏!
- JACTF misc wp
- python中年大叔学编程_中年大叔学编程-我用Python保存金山词霸每日一句
- stackoverflow 搜索问题技巧
- 使用阿里云搭建自用大数据集群(3台),含计费方式描述
- CH9101芯片应用—硬件设计指南
- 自动投票器的原理及设计思路 http://blog.csdn.net/lkfstar/archive/2008/01/12/2039070.aspx
- 二进制压缩 - 算法
- 测试开发人才稀缺,2018测试之旅来袭
热门文章
- 英语语法汇总(8.动词)
- linux dae文件下载,dae文件扩展名,dae文件怎么打开?
- android日历信息获取错误,flutter对android的日历数据相关操作
- jquery 会话存储_5个jQuery打字和会话插件
- 一图掌握PEST分析模型及案例
- POJ 2431 Expedition(贪心+优先队列)
- tp5.1 集成支付宝支付方法(二)
- 编程实现输入两个正整数m和n,求其最大公约数和最小公倍数
- ubuntu挂载U盘
- 本地搭建start.spring.io