2013面向对象序设计复习题文档.docVIP

  • 1
  • 0
  • 约3.81万字
  • 约 16页
  • 2016-09-23 发布于贵州
  • 举报
2013面向对象序设计复习题文档

面向对象程序设计考试题型: 选择题10题,共20分 填空题10题,共20分 程序阅读题3题,共15分 程序填空题,10空,共20分 简答题3题,共15分 编程题1题,共10分 程序阅读题和程序填空题 输入任意两个整数,交换后输出。 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FUXU1 { class Program { static void Main(string[] args) { int a, b, c; string strInput; Console.WriteLine(Please input two numbers); strInput = Console.ReadLine(); string[] strValues = strInput.Split(); a = int.Parse(strValues[0]); b = int.Parse(strValues[1]); Console.WriteLine(a={0},b={1}, a, b); c = a; a = b; b = c; Console.WriteLine(After changing:); Console.WriteLine(a={0},b={1}, a, b); Console.ReadKey(); } } } 从键盘上输入三个整数,输出其中的最大数。 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FUXI2 { class Program { static void Main(string[] args) { int a, b, c, max; string strInput; string[] strValues; Console.WriteLine(Input a,b,c:); strInput = Console.ReadLine(); strValues = strInput.Split( ); a = int.Parse(strValues[0]); b = int.Parse(strValues[1]); c = int.Parse(strValues[2]); Console.WriteLine(a={0},b={1},c={2}, a, b, c); if (a b) if (a c) max = a; else max = c; else if (b c) max = b; else max = c; Console.WriteLine(The biggest number is:); Console.WriteLine(max={0}, max); Console.ReadKey(); } } } 从整数半径为1的圆开始,输出圆周长,直到周长大于139.67时停止 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FUXI3 { class Program { const double PI = 3.1415926; static void Main(string[] args)

文档评论(0)

1亿VIP精品文档

相关文档