//错误的程序
using System;
class Test
{
unsafe static void WriteLocations(byte[]arr)
{
fixed(byte*p_arr=arr)
{
byte* p_elem = p_arr;
for(int i=0;i<arr.Length;i++)
byte value=*p_elem;
string addr=int.Format((int)p_elem,"x");
Console.WriteLine("arr[{0}]at0x{1}is{2}",i,addr,value);
p_elem++;
}
}
}
static void Main()
{
byte[]Array=new byte[]{1,2,3,4,5};
WriteLocations(arr);
}
static void Main()
{
F();
G();
{
H();
I();
}
} static void Main(String[]args)
{
if(args.Length==0)
goto done;
Console.WriteLine(args.Length);
done:
Console.WriteLine("Done");
} static void Main()
{
const float pi=3.14;
const int r=123;
Console.WriteLine(pi*i*i);
} static void Main()
{
int a;
int b=2,c=3;
a=1;
Console.WriteLine(a+b+c);
} static int F
using System;
class MyClass
{
public MyClass()
{
Console.WriteLine("Constructor");
}
public MyClass(int value)
{
MyField = value;
Console.WriteLine("Destructor");
}
~MyClass()
{
Console.WriteLine("Destructor");
}
public const int MyConst = 12;
public int MyField = 34;
public void MyMethod()
{
Console.WriteLine("MyClass.MyMethod");
}
public int Myproperty()
{
get{
return MyField;
}
set{
MyField=value;
}
}
public int this[int index]{
get
{
return 0;
}
set
{
Console.WriteLine("this[{0}]{1}", index, value);
}
}
public event EventHandler MyEvent;
public static MyClass operator+(MyClass a,MyClass b)
{
return new MyClass(a.MyField + b.MyField);
}
internal class MyNestedClass { } } class Constans
{
public const int A = 1;
public const int B = A + 1;
} class Test
{
static void Main()
{
Console.WriteLine("{0},{1}", Constans.A, Constans.B);
}
} //Fields
class Color
{
internal ushort redpart;
internal ushort bluepart;
internal ushort greenpart;
public Color(ushort red,ushort blue,ushort green)
{
redpart = red;
bluepart = blue;
greenpart = green;
}
} class Color
{
public static Color Red = new Color(0XFF, 0, 0);
public static Color Blue = new Color(0, 0XFF, 0);
public static Color Green = new Color(0, 0, 0XFF);
public static Color While = new Color(0, 0, 0);
}
using System;
class Point
{
public double x, y;
public Point(){
this.x=0;
this.y=0;
}
public Point(double x,double y)
{
this.x = x;
this.y = y;
}
public static double Distance(Point a,Point b)
{
double xdiff = a.x - b.x;
double ydiff = a.y - b.y;
return Math.Sqrt(xdiff * xdiff + ydiff * ydiff);
}
public override string ToString()
{
return string.Format("{0},{1}",x,y);
}
}
class Test
{
static void Main()
{
Point a = new Point();
Point b = new Point(3, 4);
double d = Point.Distance(a, b);
Console.WriteLine("Distance from {0} to {1} is {2}", a, b, d);
}
}
using System;
class Point
{
public double x, y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
~Point()
{
Console.WriteLine("Destructed {0}", this);
}
public override string ToString()
{
return string.Format("{0},{1}",x,y);
}
}
using System;
class Test
{
static void Main()
{
Type type = typedef(Class1);
object[] arr = type.GetCustomAttributes(typeof(HelpAttribute));
if (arr.Length == 0)
Console.WriteLine("Class1 has no Help attribute.");
else
{
HelpAttribute ha = (HelpAttribute)arr[0];
Console.WriteLine("Ur1={0},Topic={1}", ha.Ur1, ha.Topic);
}
}
}
using System;
class Test
{
static void Main()
{
Type type = typedef(Class1);
object[] arr = type.GetCustomAttributes(typeof(HelpAttribute));
if (arr.Length == 0)
Console.WriteLine("Class1 has no Help attribute.");
else
{
HelpAttribute ha = (HelpAttribute)arr[0];
Console.WriteLine("Ur1={0},Topic={1}", ha.Ur1, ha.Topic);
}
}
}

随机推荐

  1. Python爬取 | 王者荣耀英雄皮肤海报

    这里只展示代码,具体介绍请点击下方链接. Python爬取 | 王者荣耀英雄皮肤海报 import requests import re import os import time import wi ...

  2. 脚本注入1(boolean&&get)

    现在,我们回到之前,练习脚本支持的布尔盲注(get型). 布尔盲注的应用场景是查询成功和失败时回显不同,且存在注入点的地方. 这里以Less-8为例: 发现查询成功时,会显示:失败则无回显. 同时发现 ...

  3. Java中的函数式编程(七)流Stream的Map-Reduce操作

    写在前面 Stream 的 Map-Reduce 操作是Java 函数式编程的精华所在,同时也是最为复杂的部分.但一旦你啃下了这块硬骨头,那你就真正熟悉Java的函数式编程了. 如果你有大数据的编程经 ...

  4. Beta阶段第一次会议

    Beta阶段第一次例会 时间:2020.5.16 完成工作 姓名 完成任务 难度 完成度 lm 1.修订网页端信息编辑bug2.修订网页端登录bug(提前完成,相关issue已关闭) 中 100% x ...

  5. DDL_Killer Alpha版本 Bug集中反馈处

    本博客用于DDL_Killer Alpha版本的Bug集中反馈. 您可以在本博客的下方评论区处留言,反馈您在使用DDl_Killer的过程中遇到的问题,以帮助我们更好的改进本产品. 我们会尽快修复找到 ...

  6. 2020BUAA软工个人博客作业

    2020BUAA软工个人博客作业 17373010 杜博玮 项目 内容 这个作业属于哪个课程 2020春季计算机学院软件工程(罗杰 任健) 这个作业的要求在哪里 个人博客作业 我在这个课程的目标是 学 ...

  7. Vulnhub实战-dr4g0n b4ll靶机👻

    Vulnhub实战-dr4g0n b4ll靶机 地址:http://www.vulnhub.com/entry/dr4g0n-b4ll-1,646/ 描述:这篇其实没有什么新奇的技巧,用到的提权方式就 ...

  8. repo学习总结

    转载:https://blog.csdn.net/salmon_zhang/article/details/79180075 1. repo简介 repo是Google开发的用于管理Android版本 ...

  9. Python ImportError: No module named '_tkinter', please install the python3-tk package

    ImportError: No module named '_tkinter', please install the python3-tk package 这个问题的原因是使用的python3环境内 ...

  10. Educational Codeforces Round 113 (Rated for Div. 2)题解

    \(A,B,C\)顺利签到,还是在\(D\)上面卡住了,之后在睡前还是想出来了,看来还是自己的思维不够敏捷和成熟... D. Inconvenient Pairs 简化题意,在一个直角坐标系中,有一些 ...