- 10
- 0
- 约1.4万字
- 约 12页
- 2017-12-04 发布于贵州
- 举报
【精选】DLUT C语言程序设计作业及答案(前十周)
DLUT C语言程序设计作业及答案 (前10周) :
第一次作业
自选一个与专业学习相关的问题。提出其解决方案,并用C语言程序设计实施。程序中要求带输
入和输出格式,带 if...else和switch..case..选择结构。
#include stdio.h
#include math.h
int main()
{
int k,s;
float epsilon0,q1,q2,r,Fc,Pi=3.141593;
char ch;
while (1)
{
printf(\a\a\aToday Ill teach you a Physics law,would you like to
continue?\nPlease press Y for yes to continue,N for no to go to the end.\nY
or N: );
scanf(\n);
scanf(%c,ch);
if(ch==Y)
{
printf(\nOk,do you know the Coulomb Law?\nPress any single NUMBER
KEY to continue,its only to tell you to concentrate on this course.\n\a\a\a);
scanf(%d,k);
if(k=0k=9)
{
while (1)
{
printf(\nYou could choose one of them to
study.\nstep1:Scientist Coulomb \tstep2:Conception of Coulomb
Law\nstep3:Fomular of the Law \tstep4:Practice to use the Law\nPlease press
1 for SC to step1\n 2 for CC to step2\n 3 for FC to step3\
4 for PC to step4\n 0 for EXIT\n);
scanf(%d,s);
switch(s)
{
case 1:
// Created by xuanzai93 on 12-4-20.
// Copyright (c) 2012, DLUT. All rights reserved.
printf(The Coulomb(Charlse,-Augustin de
Coulomb,1736-1806),French engineer,physicist.\nJune14,1736,was born in
Angouleme,France.Died in Paris on August23,1806.\n\n\n);
break;
case 2:
printf(Coulombs law states that: \n\The magnitude of
the Electrostatics force of interaction between two point charges\nis directly
proportional to the scalar multiplication of the magnitudes of charges\nand
inversely proportional to the square of
您可能关注的文档
- 【精选】CRRT置换液配置.ppt
- 【精选】CS01-01《人际沟通技巧》讲师手册.doc
- 【精选】CSC9000T自我评估表.pdf
- 【精选】CSC-HR调研问卷(顾问:韩召和).pdf
- 【精选】CSB经典案例分析-自由工业公司化学品储罐泄漏污染公共水事故(2016-10期).pdf
- 【精选】CSharp_11_1_理解参数数组.ppt
- 【精选】CSDN2012软件行业薪酬调查.doc
- 【精选】CSSCI2004.doc
- 【精选】CSSCI【财贸经济】我国文化产业国际竞争力比较及提升策略_基于2011年横截面数据的分析.pdf
- 【精选】CSSCI【山西财经大学学报】文化资源产业开发的投资结构及融资渠道拓展.pdf
- 广西南宁2025-2026秋季期末八年级【语文】试卷(含答案).pdf
- 广西南宁2025-2026秋季期末高一化学试卷(含答案).pdf
- 广西南宁2025-2026秋季期末九年级数学试卷(含答案).pdf
- 广西南宁2025-2026秋季期末高一英语(含答案,无听力音频).pdf
- 广西南宁2025-2026秋季期末高一地理试卷(含答案).pdf
- 内科护理(中职):心包疾病病人的护理PPT教学课件.ppt
- 胆管结石的中医护理方法.ppt
- 内科护理(中职):心肌疾病病人的护理PPT教学课件.ppt
- 内科护理(中职):心律失常病人的护理PPT教学课件.ppt
- 嵌入式系统实践及工程应用—从基础到人工智能:具备AI算力的嵌入式系统开发PPT教学课件.pptx
原创力文档

文档评论(0)