【精选】DLUT C语言程序设计作业及答案(前十周).pdfVIP

  • 10
  • 0
  • 约1.4万字
  • 约 12页
  • 2017-12-04 发布于贵州
  • 举报

【精选】DLUT C语言程序设计作业及答案(前十周).pdf

【精选】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

文档评论(0)

1亿VIP精品文档

相关文档