代码拉取完成,页面将自动刷新
//using System;
//using System.Collections.Generic;
//using System.Text;
//namespace c_sharp_experiment02
//{
// class CRect
// {
// private int top, bottom, left, right;
// public static int total_rects = 0;
// public static long total_rect_area = 0;
// public CRect(){
// left = top = right = bottom = 0;
// total_rects++;
// total_rect_area += getHeight() * getWidth();
// Console.WriteLine("CRect() Constructing rectangle numer{0}", total_rects);
// Console.WriteLine("Total rectangle areas is:{0}", total_rect_area);
// }
// public CRect(int x1,int y1,int x2,int y2) {
// left = x1;top = y1;
// right = x2;bottom = y2;
// total_rects++;
// total_rect_area+= getHeight() * getWidth();
// Console.WriteLine("CRect(int,int,int,int) Constructing rectangle numer{0}", total_rects);
// Console.WriteLine("Total rectangle areas is:{0}", total_rect_area);
// }
// public CRect(CRect r) {
// left = r.left;
// right = r.right;
// top = r.top;
// bottom = r.bottom;
// total_rects++;
// total_rect_area += getHeight() * getWidth();
// Console.WriteLine("CRect(CRect&) Constructing rectangle numer{0}", total_rects);
// Console.WriteLine("Total rectangle areas is:{0}", total_rect_area);
// }
// public int getHeight() {
// return top > bottom ? top - bottom : bottom - top;
// }
// public int getWidth() {
// return right > left ? right - left : left - right;
// }
// public static int getTotalRects() {
// return total_rects;
// }
// public static long getTotalTectArea() {
// return total_rect_area;
// }
// }
// class Test2_4 {
// public static void Main(string[] args) {
// CRect rect1 = new CRect(1, 3, 6, 4), rect2 = new CRect(rect1);
// Console.WriteLine("Rectangle 2:Height:{0},Width:{1}",rect2.getHeight(),rect2.getWidth());
// {
// CRect rect3 = new CRect();
// Console.WriteLine("Rectangle3:Height:{0},Width:{1}", rect3.getHeight(), rect3.getWidth());
// }
// Console.Write("total_rects={0},", CRect.total_rects);
// Console.WriteLine("total_rect_area={0}", CRect.total_rect_area);
// }
// }
//}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。