You are on page 1of 2

-7 Infinity :

-8 )( B b = new B B A
A A . )( b.Test B .
:
A
B
-9 . )( B b = new C C B

C B . )( Test B
A new .
C . C.
-10 10 . ) a.a = Inc(a ) Inc(A a . a.a
++ .

= a.a

) Inc(a a (a.a) a 10 .
-11
struct Point
{
;public int x
;public int y
public int z = 0; //
//.

)(public Point
{
;x = 0
;y = 0
;z = 0
}

)public Point(int x, int y


{
this.x = x;//.
;this.y = y
}
)public Point(int x, int y, int z
{
;this.x = x
;this.y = y
;this.z = z
}
}

-12
)int[] Add(int[] a, int[] b
{
;int length, i
)if (a.Length > b.Length
;length = a.Length + 1
else
;length = b.Length + 1

int[] result = new int[length];


for (i = 0; i < a.Length && i < b.Length; i++)
{
result[i] += (a[i] + b[i]) % 10;
result[i + 1] = (a[i] + b[i]) / 10;
}
for (; i < a.Length; i++)
result[i] += a[i];
for (; i < b.Length; i++)
result[i] += b[i];
}

return result;

-13
void PrintStrings(params object[] items)
{
for (int i = 0; i < items.Length; i++)
if (items[i] is string)
Console.WriteLine((string)items[i]);
}

-14
bool isCorrect;
int a;
do
{
try
{
isCorrect = true;
a = int.Parse(Console.ReadLine());
}
catch
{
isCorrect = false;
}
} while (!isCorrect);

-15
void PrintDirectories(DirectoryInfo dir)
{
ArrayList subDirs = new ArrayList();
subDirs.Add(dir);

while(subDirs.Count!=0)
{
dir = (DirectoryInfo)subDirs[0];
subDirs.RemoveAt(0);
foreach (DirectoryInfo sub in dir.GetDirectories())
{
Console.WriteLine(sub.FullName);
subDirs.Add(sub);
}
}