- 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)
您可能关注的文档
最近下载
- 石竹山签谱详解100.doc VIP
- 中医临床诊疗术语标准及应用.docx VIP
- 2025年湘西土家族苗族自治州民族中医院医护人员招聘备考试题及答案解析.docx VIP
- 石竹山签谱全100签详解.pdf VIP
- 2023年高考历史真题:2023年高考山东历史真题及答案.pdf VIP
- 2025-2026学年人教版八年级数学上册期末考试试卷.pdf VIP
- 2023年高考历史真题试卷(新课标卷)(含答案及详细解析) .pdf VIP
- 2026中考英语复习《主谓一致》课件.pptx
- 2024年湘西土家族苗族自治州民族中医院医护人员招聘备考试题及答案解析.docx VIP
- 2025-2026学年小学科学六年级上册青岛版(六三制2024)教学设计合集.docx
原创力文档

文档评论(0)