首页 > 其他 > 详细

结构体

时间:2019-03-03 21:58:28      阅读:189      评论:0      收藏:0      [点我收藏+]
 1 using System;
 2 
 3 struct Point
 4 {
 5     public double x, y;
 6     
 7     public Point(int x, int y) {
 8         this.x = x;
 9         this.y = y;
10     }
11 
12     public double R(){
13         return Math.Sqrt(x*x+y*y);
14     }
15 }
16 
17 class Tes
18 {
19     static void Main() {
20         Point[] points = new Point[100];
21 
22         for (int i = 0; i < 100; i++)
23             points[i] = new Point(i, i*i);
24     }
25 }

 

结构体

原文:https://www.cnblogs.com/GoldenEllipsis/p/10467856.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!