日期:2014-05-17 浏览次数:20900 次
/* (程序头部注释开始)
* 程序的版权和版本声明部分
* Copyright (c) 2011, 烟台大学计算机学院学生
* All rights reserved.
* 文件名称: 《坐标点的运算——C#第四周》
* 作 者: 刘江波
* 完成日期: 2012 年 9 月 18 日
* 版 本 号: v1.2
* 对任务及求解方法的描述部分
* 问题描述:
* 程序头部的注释结束
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
CPoint p = new CPoint();
p.display();
p.setpointQ(80, 150);
Console.WriteLine("重新置值....");
p.display();
Console.ReadKey();
}
}
class CPoint
{
private int x;
private int y;
public CPoint()
{
x = 60;
y = 75;
}
public void setpointQ(int a,int b)
{
x = a;
y = b;
}
public void display()
{
Console.Write("坐标值为:");
Console.WriteLine("x = " + x + ", " + "y = " + y);
}
}
}