/**烟台大学计算机学院学生
*All right reserved.
*文件名称:C#-—体验结构
*作者:杨飞
*完成日期:2014年9月2日
*版本号:v1.0
*对任务及求解方法的描述部分:C#-—体验结构
*我的程序:*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
struct point
{
private int x, y;
public point(int x,int y)
{
this.x=x;
this.y=y;
}
public int getx()
{
return x;
}
public int gety()
{
return y;
}
}
class Program
{
static void Main(string[] args)
{
point s = new point(1,2);
Console.WriteLine("横坐标:{0},纵坐标:{1}",s.getx(),s.gety());
Console.ReadKey();
}
}
}
运行结果:
心得体会:呵呵