没有合适的资源?快使用搜索试试~ 我知道了~
(word完整版)计算机程序设计基础(C语言)编程习题.doc
需积分: 9 1 下载量 142 浏览量
2022-10-24
01:49:35
上传
评论 1
收藏 137KB DOC 举报
温馨提示
试读
17页
(word完整版)计算机程序设计基础(C语言)编程习题.doc
资源详情
资源评论
资源推荐
(word 完整版)计算机程序设计基础(C 语言)编程习题
清水混凝土的配合比设计中,要针对当地水泥、砂石、外掺料及外加剂等原材料影响混凝土质量的多种因素进行分析,确定主要控制因素,并从经济性和使用要求综合考虑,优选出符合生产条件的最优方案组合。obstacles, correcting misunderstandings, advocate good cadre style. 2, adhere to the scientific decision-making and democratic decision-making decision-making law. Correctly handle to ensure that government decrees and based on the actual creative work, giving full play to subjective initiative, put an end to implement the conference meeting, to document the implementation of documents etc. Improve the scientific and democratic decision-making mechanism, improve and implement the decision to solicit the views of experts, the public hearing system. Improve the important decision of risk assessment mechanism and legal review mechanism. 3, to promote team unity. Uphold and improve the system of annual party book talk heart to heart, mind and Party members, Party members to exchange each other not less than 2 times. The implementation of sound team democratic life system, consolidate and enhance the party's mass line educational practice will promote the achievement of the topic of democratic life, criticism and self-criticism normalization, a long-term. Adhere to the party on the basis of the principle of unity, enhance internal communication, strengthen internal supervision, self Sleep maintenance team collective image and authority. (three) to ensure the execution is not strong or disguised to resist government decrees issues. Individual Bureau leadership team members lack of learning political theory system, not from the objective reality, not with the party's interests above all the principles to deal with personal problems. In the specific work safety supervision in the execution is not strong, in the implementation of the decision to deploy the discount, make choices, engage in work, the implementation of the agreement, uncomfortable is not performed, open or disguised to resist, the lack of subject consciousness of the party organization, the lack of resist in society all kinds of bad habits and unwholesome tendencies of courage Gas and courage. Such as the liability insurance of safe production work, individual leaders that have someone arrested, and no funding, not in the global chess perspective to the countryside to carry out daily inspection, found none of my business acceptance of the resumption of production in an armchair, with a pen, indifferent. Corrective measures: (LED Leadership: Luo Mingjun, rectification time: before September 25th, insist for a long time) 1, to strengthen the sense of responsibility, work to solve the lack of decent occupation explain away, conduct problems. To establish the overall concept, eliminate departmentalism. Strict assessment and accountability, to solve the spiritual slack, nianqingpazhong, status quo, To establish and perfect the muddle along and other issues. Bureau staff conduct work regulations, standardize the behavior of personnel. 2, strengthen the responsibility system. One is the in-depth study and implement the "Hunan provincial Party and government leading cadres Interim Provisions on the work safety of a pair of > (Hunan Office issued 2013 No.
1
计算机程序设计基础(C 语言)
编程练习题及参考答案
1。输入 2 个整数,求两数的平方和并输出.
#include 〈stdio。h>
main()
{ intt a ,b,s;
printf(”please input a,b:");
scanf("%d%d”,&a,&b);
s=a*a+b*b;
printf("the result is %d",s);
}
2. 输入一个圆半径(r)当 r〉=0 时,计算并输出圆的面积和周长,否则,输出提示信息。
#include <stdio。h>
#define PI 3.14 <stdio。h>
main()
{ float r ,s , l;
printf(”please input r:”);
scanf("%f",&r);
if (r>=0)
{s=pi*r*r;
l=2*i*r ;
printf(”the area is %f",s);
printf("the circumference is %f”,l);}
else
printf(”input error!");
}
3、函数 y=f(x)可表示为:
2x+1 (x〈0)
y= 0 (x=0)
2x-1 (x>0)
编程实现输入一个 x 值,输出 y 值.
main()
{int x,y;
scanf(“%d”,&x);
If(x〈0)y=2*x+1;
If(x>0)y=2*x-1;
If(x==0) y=0;
printf(“%d",y);}
4、编写一个程序,从 4 个整数中找出最小的数,并显示此数。
main( )
{int a,b,c,d,t;
scanf (“%d,%d,%d,%d ”,&a,&b,&c,&d);
if (a〉b)
{t=a; a=b; b=t;}
if (a〉c)
(word 完整版)计算机程序设计基础(C 语言)编程习题
清水混凝土的配合比设计中,要针对当地水泥、砂石、外掺料及外加剂等原材料影响混凝土质量的多种因素进行分析,确定主要控制因素,并从经济性和使用要求综合考虑,优选出符合生产条件的最优方案组合。obstacles, correcting misunderstandings, advocate good cadre style. 2, adhere to the scientific decision-making and democratic decision-making decision-making law. Correctly handle to ensure that government decrees and based on the actual creative work, giving full play to subjective initiative, put an end to implement the conference meeting, to document the implementation of documents etc. Improve the scientific and democratic decision-making mechanism, improve and implement the decision to solicit the views of experts, the public hearing system. Improve the important decision of risk assessment mechanism and legal review mechanism. 3, to promote team unity. Uphold and improve the system of annual party book talk heart to heart, mind and Party members, Party members to exchange each other not less than 2 times. The implementation of sound team democratic life system, consolidate and enhance the party's mass line educational practice will promote the achievement of the topic of democratic life, criticism and self-criticism normalization, a long-term. Adhere to the party on the basis of the principle of unity, enhance internal communication, strengthen internal supervision, self Sleep maintenance team collective image and authority. (three) to ensure the execution is not strong or disguised to resist government decrees issues. Individual Bureau leadership team members lack of learning political theory system, not from the objective reality, not with the party's interests above all the principles to deal with personal problems. In the specific work safety supervision in the execution is not strong, in the implementation of the decision to deploy the discount, make choices, engage in work, the implementation of the agreement, uncomfortable is not performed, open or disguised to resist, the lack of subject consciousness of the party organization, the lack of resist in society all kinds of bad habits and unwholesome tendencies of courage Gas and courage. Such as the liability insurance of safe production work, individual leaders that have someone arrested, and no funding, not in the global chess perspective to the countryside to carry out daily inspection, found none of my business acceptance of the resumption of production in an armchair, with a pen, indifferent. Corrective measures: (LED Leadership: Luo Mingjun, rectification time: before September 25th, insist for a long time) 1, to strengthen the sense of responsibility, work to solve the lack of decent occupation explain away, conduct problems. To establish the overall concept, eliminate departmentalism. Strict assessment and accountability, to solve the spiritual slack, nianqingpazhong, status quo, To establish and perfect the muddle along and other issues. Bureau staff conduct work regulations, standardize the behavior of personnel. 2, strengthen the responsibility system. One is the in-depth study and implement the "Hunan provincial Party and government leading cadres Interim Provisions on the work safety of a pair of > (Hunan Office issued 2013 No.
2
{t=a; a=c; c=t;}
if (a>d)
{t=a; a=d; d=t;}
printf (“min = %d \n”,a);
}
5.有一函数当 x<0 时 y=1,当 x〉0 时,y=3,当 x=0 时 y=5,编程,从键盘输入一个 x 值,输出 y 值。
main()
{int x,y;
scanf(”%d”,&x);
if (x〈0) y=1;
else if(x==0) y=5;
else y=3;
printf(”x=%d,y=%d\n”,x,y);}
6.从键盘输入两个数,求出其最大值(要求使用函数完成求最大值,并在主函数中调用该函数)
main()
{float max(float x,float y);
float a,b,m;
scanf("%f,%f”,&a,&b);
m=max(a,b);
printf("Max is %f\n",m);
}
float max(float x,float y)
{
float temp;
if (x<y)
{temp=x;
x=y;
y=temp;
}
return(x);
}
7、从键盘输入你和你朋友的年龄,编成判断谁的年龄最大,并打印最大者的年龄。
#include <stdio。h>
main()
{ int yourAge, hisAge;
printf(”Please enter your age:");
scanf("%d”, &yourAge); /*输入你的年龄 yourAge*/
printf("Please enter your friend's age:");
scanf("%d”, &hisAge); /*输入你朋友的年龄 hisAge*/
if (yourAge 〉= hisAge)
{
printf(”You are older! Your age is = %d\n", yourAge);
}
if (hisAge > yourAge)
{
printf("Your friend is older! HisAge age is = %d\n", hisAge);
(word 完整版)计算机程序设计基础(C 语言)编程习题
清水混凝土的配合比设计中,要针对当地水泥、砂石、外掺料及外加剂等原材料影响混凝土质量的多种因素进行分析,确定主要控制因素,并从经济性和使用要求综合考虑,优选出符合生产条件的最优方案组合。obstacles, correcting misunderstandings, advocate good cadre style. 2, adhere to the scientific decision-making and democratic decision-making decision-making law. Correctly handle to ensure that government decrees and based on the actual creative work, giving full play to subjective initiative, put an end to implement the conference meeting, to document the implementation of documents etc. Improve the scientific and democratic decision-making mechanism, improve and implement the decision to solicit the views of experts, the public hearing system. Improve the important decision of risk assessment mechanism and legal review mechanism. 3, to promote team unity. Uphold and improve the system of annual party book talk heart to heart, mind and Party members, Party members to exchange each other not less than 2 times. The implementation of sound team democratic life system, consolidate and enhance the party's mass line educational practice will promote the achievement of the topic of democratic life, criticism and self-criticism normalization, a long-term. Adhere to the party on the basis of the principle of unity, enhance internal communication, strengthen internal supervision, self Sleep maintenance team collective image and authority. (three) to ensure the execution is not strong or disguised to resist government decrees issues. Individual Bureau leadership team members lack of learning political theory system, not from the objective reality, not with the party's interests above all the principles to deal with personal problems. In the specific work safety supervision in the execution is not strong, in the implementation of the decision to deploy the discount, make choices, engage in work, the implementation of the agreement, uncomfortable is not performed, open or disguised to resist, the lack of subject consciousness of the party organization, the lack of resist in society all kinds of bad habits and unwholesome tendencies of courage Gas and courage. Such as the liability insurance of safe production work, individual leaders that have someone arrested, and no funding, not in the global chess perspective to the countryside to carry out daily inspection, found none of my business acceptance of the resumption of production in an armchair, with a pen, indifferent. Corrective measures: (LED Leadership: Luo Mingjun, rectification time: before September 25th, insist for a long time) 1, to strengthen the sense of responsibility, work to solve the lack of decent occupation explain away, conduct problems. To establish the overall concept, eliminate departmentalism. Strict assessment and accountability, to solve the spiritual slack, nianqingpazhong, status quo, To establish and perfect the muddle along and other issues. Bureau staff conduct work regulations, standardize the behavior of personnel. 2, strengthen the responsibility system. One is the in-depth study and implement the "Hunan provincial Party and government leading cadres Interim Provisions on the work safety of a pair of > (Hunan Office issued 2013 No.
3
}}
8、键盘输入 2 个加数,再输入答案,如果正确,显示“right”,否则显示“error”
#include “stdio.h”
main( )
{int a,b,c;
printf(“please input a and b\n”);
scanf (%d,%d”,&a,&b);
printf(“please input the answer for a+b\n”);
scanf (%d”,&c);
if (c==a+b)
printf(“right\n”);
else
printf(“error\n”);
}
9。 编一程序每个月根据每个月上网时间计算上网费用,计算方法如下:
�
�
�
�
�
�
�
�
�
小时
小时
小时
元每小时
元每小时
元
费用
50
5010
10
5.2
3
30
要求当输入每月上网小时数,显示该月总的上网费用(6 分)
main()
{ int hour;
float fee;
printf(“please input hour:\n");
scanf(“%d”,&hour);
if(hour〈=10)
fee=30;
else if(hour〉=10&&hour〈=50)
fee=3*hour;
else fee=hour*2。5;
printf(“The total fee is %f”,fee);
}
10。神州行用户无月租费,话费每分钟 0.6 元,全球通用户月租费 50 元,话费每分钟 0。 4 元。输入一个
月的通话时间,分别计算出两种方式的费用,判断哪一种合适。
main()
{float a,x,y;
printf(“\n 请输入您的话费:”);
scanf(“%f,”,&a);
x= 0.6*a;
y=50+0。4*a;
printf (“神州行话费为: %f\n”,x);
printf (“全球通话费为: %f\n”,y);
if (x〉=y)
printf(“建议使用全球通”);
else printf(“建议使用神州行);
}
(word 完整版)计算机程序设计基础(C 语言)编程习题
清水混凝土的配合比设计中,要针对当地水泥、砂石、外掺料及外加剂等原材料影响混凝土质量的多种因素进行分析,确定主要控制因素,并从经济性和使用要求综合考虑,优选出符合生产条件的最优方案组合。obstacles, correcting misunderstandings, advocate good cadre style. 2, adhere to the scientific decision-making and democratic decision-making decision-making law. Correctly handle to ensure that government decrees and based on the actual creative work, giving full play to subjective initiative, put an end to implement the conference meeting, to document the implementation of documents etc. Improve the scientific and democratic decision-making mechanism, improve and implement the decision to solicit the views of experts, the public hearing system. Improve the important decision of risk assessment mechanism and legal review mechanism. 3, to promote team unity. Uphold and improve the system of annual party book talk heart to heart, mind and Party members, Party members to exchange each other not less than 2 times. The implementation of sound team democratic life system, consolidate and enhance the party's mass line educational practice will promote the achievement of the topic of democratic life, criticism and self-criticism normalization, a long-term. Adhere to the party on the basis of the principle of unity, enhance internal communication, strengthen internal supervision, self Sleep maintenance team collective image and authority. (three) to ensure the execution is not strong or disguised to resist government decrees issues. Individual Bureau leadership team members lack of learning political theory system, not from the objective reality, not with the party's interests above all the principles to deal with personal problems. In the specific work safety supervision in the execution is not strong, in the implementation of the decision to deploy the discount, make choices, engage in work, the implementation of the agreement, uncomfortable is not performed, open or disguised to resist, the lack of subject consciousness of the party organization, the lack of resist in society all kinds of bad habits and unwholesome tendencies of courage Gas and courage. Such as the liability insurance of safe production work, individual leaders that have someone arrested, and no funding, not in the global chess perspective to the countryside to carry out daily inspection, found none of my business acceptance of the resumption of production in an armchair, with a pen, indifferent. Corrective measures: (LED Leadership: Luo Mingjun, rectification time: before September 25th, insist for a long time) 1, to strengthen the sense of responsibility, work to solve the lack of decent occupation explain away, conduct problems. To establish the overall concept, eliminate departmentalism. Strict assessment and accountability, to solve the spiritual slack, nianqingpazhong, status quo, To establish and perfect the muddle along and other issues. Bureau staff conduct work regulations, standardize the behavior of personnel. 2, strengthen the responsibility system. One is the in-depth study and implement the "Hunan provincial Party and government leading cadres Interim Provisions on the work safety of a pair of > (Hunan Office issued 2013 No.
4
11.个人所得税计算,应纳税款的计算公式如下:
收入
税率
收入<=1000 元部分
0%
2000 元>=收入>1000 元的部分
5%
3000 元〉=收入〉2000 元的部分
10%
6000 元>=收入〉3000 元的部分
15%
收入〉6000 元的部分
20%
输入某人的收入,计算出应纳税额及实际得到的报酬.(7 分)
(如需连续计算多个人的纳税情况,直到输入负数为止,程序应如何改进?试写出程序)
#include “stdio。h"
main()
{
int grade;
float income,tax,money;
printf(“please input your income\n”);
scanf (“%f”,&income);
if (income〈0)
printf(“the input is error”);
else
{ grade=(int)income/1000;
switch(grade)
{ case 0 : tax=0;break;
case 1 : tax=(income-1000)*0。05;break;
case 2 : tax=50+(income—2000)*0。1;break;
case 3 :
case 4 :
case 5 : tax=150+(income-3000)*0。15;break;
default: tax=600+(income-6000)*0.2;
}
money=income-tax;
printf(“\n tax=%f, money=%f”,tax, money);
}
}
12.从键盘上输入一个百分制成绩 score,按下列原则输出其等级:score≥90,等级为 A;80≤score<90,
等级为 B;70≤score〈80,等级为 C;60≤score〈70,等级为 D;score<60,等级为 E.
#include <stdio。h>
main()
{
int data;
char grade;
printf(”Please enter the score:");
scanf("%d”, &data);
switch(data/10)
{ case 10:
case 9 : grade=’A’; break;
剩余16页未读,继续阅读
智慧安全方案
- 粉丝: 3652
- 资源: 59万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 详解protobuf-c之在C语言中如何使用repeated生成数组和字符串(包含配置pb-callback-t)
- Python 程序语言设计模式思路-并发模式:消费者模式:协调生产者和消费者之间的数据交换
- pythonA*算法(A-star algorithm),寻路算法
- guitest.zip
- udp_echo.v
- udp_echo_server.v
- python双向广度优先搜索算法(Bidirectional Breadth-First Search, BBFS),寻路算法
- python迭代加深算法(Iterative Deepening Depth-First Search, IDDFS),寻路算法
- 京东商品链接采集助手 2024版
- 基于Java的ApplicationPower快速项目生成脚手架设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0