using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Rectangle
{
double length;
double width;
public void Acceptde()
{
length = 4.5;
width = 3.5;
}
public double Getare()
{
return length * width;
}
public void Display()
{
Console.WriteLine("Length:{0}",length);
Console.WriteLine("Width:{0}", width);
Console.WriteLine("Area:{0}", Getare());
}
}
class Program
{
static void Main(string[] args)
{
int[] a = new int[10];
for(int i = 0;i < 5;i++)
{
a[i] = i;
Console.WriteLine(i);
}
foreach(int j in a)
{
int i = j - 100;
Console.WriteLine(j);
}
string fname, lname;
fname = "hello";
lname = "jiang";
Console.WriteLine(fname + " " + lname);
Rectangle r = new Rectangle();
r.Acceptde();
r.Display();
Console.ReadKey();
}
}
}
C#(number1)
最新推荐文章于 2022-07-26 10:15:53 发布