AnswerSoft(M.Fudano)
2005-01-13 05:53:50 UTC
$B$3$s$K$A$O!"(B!(^^)!$B$U!A$G$9!#(B
C#$B9=B$BN$r??LLL\$K5-=R$K$O$I$&$9$k$N$+$J$!$HJY6/Cf$G$9!#(B
$B$J$s$H!"!V(BC++$B!W$+$iHf$Y$k$H?oJ,3HD%$5$l$?$b$N$G$9!#$$$D$b$O!"(B
$B0lIt$N5!G=$7$+;H$C$F$J$$!#$HH?>J$G$9!#(B
$B$=$l$G!"%5%s%W%k:***@.!#$H$3$m$,!"%&%)%C%A$G!V(BTom$B!W(B
$B$r8+$^$9$H!"(BItem <$B%$%s%G%C%/%9$N%W%m%Q%F%#$rI=<($G$-$^$;$s(B>
$B$J$I$H$"$k$N$G$9$,!"M=$a!"%*%V%8%'%/%H$+2?=h$+$KDj5A$,$"$k$N$G$7$g$&!#(B
$B$7$+$7!"$H$F$b5$$K$J$j$^$9!#!!2?$G$7$g$&$3$l$O!)!!(BItem$B$rDj5A$7$F(B
$B$3$N%a%C%;!<%8$r>C$7$?$$$N$G$9$,$I$&$9$k$N$G$7$g$&$+!)!!$465<x$*4j$$CW$7$^$9!#(B
$B!V%3%s%=!<%k%"%W%j%1!<%7%g%sMQ!W(B
using System;
namespace ConsoleApplicationTest1
{
struct DATA1
{
public const int MaxData = 10;
public int Number;
private static int[] $B!!(B Array;
// Static Initialization
static DATA1()
{
Array = new int[MaxData];
}
// Index creation
public int this[int index]
{
get
{
// Check the index limits.
if (index < 0 || index >= MaxData)
return 0;
else
return Array[index];
}
set
{
// Check the index limits.
if (0 < index && index < MaxData)
Array[index] = value;
}
}
// Override the ToString method:
public override string ToString()
{
return(String.Format("(MaxData={0},Number={1})", MaxData, Number));
}
}
/// <summary>
/// Class1 $B$N35MW$***@bL@$G$9!#(B
/// </summary>
class Class1
{
/// <summary>
/// $B%"%W%j%1!<%7%g%s$N%a%$%s(B $B%(%s%H%j(B $B%]%$%s%H$G$9!#(B
/// </summary>
[STAThread]
static void Main(string[] args)
{
int no;
//$BKt$O!"(BDATA1 Tom = new DATA1();
DATA1 Tom;
// $B%G!<%?3JG<=hM}(B
Tom.Number = DATA1.MaxData;
for( no = 0; no < Tom.Number ; no++ ) Tom[no] = no;
//$B!!I=<(=hM}(B
Console.WriteLine( Tom );
for( no = 0; no < Tom.Number ; no++ )
{
Console.Write(Tom[no]);
if(no != Tom.Number-1) Console.Write(", ");
}
Console.Write("\n");
}
}
}
C#$B9=B$BN$r??LLL\$K5-=R$K$O$I$&$9$k$N$+$J$!$HJY6/Cf$G$9!#(B
$B$J$s$H!"!V(BC++$B!W$+$iHf$Y$k$H?oJ,3HD%$5$l$?$b$N$G$9!#$$$D$b$O!"(B
$B0lIt$N5!G=$7$+;H$C$F$J$$!#$HH?>J$G$9!#(B
$B$=$l$G!"%5%s%W%k:***@.!#$H$3$m$,!"%&%)%C%A$G!V(BTom$B!W(B
$B$r8+$^$9$H!"(BItem <$B%$%s%G%C%/%9$N%W%m%Q%F%#$rI=<($G$-$^$;$s(B>
$B$J$I$H$"$k$N$G$9$,!"M=$a!"%*%V%8%'%/%H$+2?=h$+$KDj5A$,$"$k$N$G$7$g$&!#(B
$B$7$+$7!"$H$F$b5$$K$J$j$^$9!#!!2?$G$7$g$&$3$l$O!)!!(BItem$B$rDj5A$7$F(B
$B$3$N%a%C%;!<%8$r>C$7$?$$$N$G$9$,$I$&$9$k$N$G$7$g$&$+!)!!$465<x$*4j$$CW$7$^$9!#(B
$B!V%3%s%=!<%k%"%W%j%1!<%7%g%sMQ!W(B
using System;
namespace ConsoleApplicationTest1
{
struct DATA1
{
public const int MaxData = 10;
public int Number;
private static int[] $B!!(B Array;
// Static Initialization
static DATA1()
{
Array = new int[MaxData];
}
// Index creation
public int this[int index]
{
get
{
// Check the index limits.
if (index < 0 || index >= MaxData)
return 0;
else
return Array[index];
}
set
{
// Check the index limits.
if (0 < index && index < MaxData)
Array[index] = value;
}
}
// Override the ToString method:
public override string ToString()
{
return(String.Format("(MaxData={0},Number={1})", MaxData, Number));
}
}
/// <summary>
/// Class1 $B$N35MW$***@bL@$G$9!#(B
/// </summary>
class Class1
{
/// <summary>
/// $B%"%W%j%1!<%7%g%s$N%a%$%s(B $B%(%s%H%j(B $B%]%$%s%H$G$9!#(B
/// </summary>
[STAThread]
static void Main(string[] args)
{
int no;
//$BKt$O!"(BDATA1 Tom = new DATA1();
DATA1 Tom;
// $B%G!<%?3JG<=hM}(B
Tom.Number = DATA1.MaxData;
for( no = 0; no < Tom.Number ; no++ ) Tom[no] = no;
//$B!!I=<(=hM}(B
Console.WriteLine( Tom );
for( no = 0; no < Tom.Number ; no++ )
{
Console.Write(Tom[no]);
if(no != Tom.Number-1) Console.Write(", ");
}
Console.Write("\n");
}
}
}