PDA

View Full Version : Help code c#



heenoowoon
11-09-2010, 18:05
using System;
using System.Collections.Generic;
using System.Text;

namespace bai1
{
class Genenel
{
int n;
public Genenel (int n)
{
this.n = n;
}
public int giaithua()
{
int gt = 1;
for (int i = 1; i <= n; i++)
gt = i * gt;
}
public void hienthi()
{
Console.WriteLine ("giai thua " + n + "la: " + giaithua().ToString());
}
static void Main(string[] args)
{
Genenel gthua = new Genenel(9);
gthua.hienthi();
Console.ReadLine();
}
}
}