13. 犖犖迦牽犖迦検犖巌 犖犖犖犢犖 犖犖犢犖÷犢犖 犖
犢犖÷犢犖犖犖犖迦検犖迦牽犖犖犖犖萎犖迦絹犢犖犢犖犖園犢犖犢犖犖園犖犖犖犖謹犖 犖犖犖劇賢
犖犖ム顕犖∇犖迦牽犖迦検犖巌犖犖犖犢
犢犖÷厳犢犖犢犖犖朽権犖犢犖÷犢犖犖
犖犖橿顕犖犖о犖犖巌犖犖犢犖犢犖犖犢犖犢犖迦犖園犖犖橿顕犖犖о犖犖迦牽犖迦検犖巌犖犖犖犢犖犖朽
犖犖橿顕犖犖犖
class MethodEx {{
class MethodEx
static void Main() { 犖犖犖犖犖犖犖ム犖犖犖犖園
犖犖犖萎犖犖犖犢犖犖÷弦犖 {
static void Main() 犖犢
}}
int xx == Method1();
int
Method1();
Method2(x, "Hello", 3.5);
Method2(x, "Hello", 3.5);
static int Method1() {{
static int Method1()
::
}}
}}
static void Method2(int a, string x, double b) {{
static void Method2(int a, string x, double b)
::
}}
14. 犢犖犖犖犖謹 犖犖園
犖犖巌犖迦牽犖犖迦犖犢犖
犖犖迦犖犖橿顕犖犖迦牽犢犖犖朽権犖犢犖÷犢犖犖
犢犖
Main() 犖犖迦牽犢犖犖朽権犖犢犖÷犢犖犖
犢犖犖犖項犖犢犖犖?
1.
2.
3.
4.
5.
6.
7.
class Quiz {
class Quiz {
static void Main() {
static void Main() {
int x, y; string s, t;
int x, y; string s, t;
:
:
:
:
}
}
static int Hello()
static int Hello()
{
{
:
:
}
}
x = Hello();
Hello("everyone");
Hello();
Hi(s, y);
y = Hi(3, t);
Hi(x, "there");
Hi(x, x);
static void Hi(int a, string b)
static void Hi(int a, string b)
{
{
:
:
}
}
}
}
static void Hi(int a, int b)
static void Hi(int a, int b)
{
{
:
:
}
}
15. 犖犖園硯 犖犖∇犖 犖犢犖÷犢犖 犖 #1
犢犖犖朽権犖犢犖÷犢犖犖 RectArea
犖犖園犖犖迦牽犖迦検犖巌犖犖犖犢: int w, int h
犖犖橿顕犖犖о犢犖ム鍵犖犢犖犖犖劇犖犢犖迦犖劇犖犖犖朽犖犖犖犖犖朽犖犖ム元犢犖∇検
犢
犖犖劇犖犢犖迦犖朽犖÷元犖犖о顕犖÷犖о犖迦犢犖犢犖迦犖園 w 犢犖ム鍵犖犖о顕犖
犖犖項犢犖犢犖迦犖園 h
static int RectArea(int w, int h) {
static int RectArea(int w, int h) {
int area;
int area;
area = w * h;
area = w * h;
return area;
return area;
}
}
16. 犖犖園硯 犖犖∇犖 犖犢犖÷犢犖 犖 #2
犢犖犖朽権犖犢犖÷犢犖犖 PrintRect
犖犖園犖犖迦牽犖迦検犖巌犖犖犖犢: int w, int h
犖犖巌検犖犢犖犖項犖犖朽犖犖ム元犢犖∇検犖犖劇犖犢犖迦犖犖迦犖犖о顕犖÷犖о犖迦
犢
w 犢犖ム鍵犖犖о顕犖÷肩犖項 h 犖犢犖о権犖犖園犖犖犖 '* ' 犖犖犖犖犢犖
犖犖 void PrintRect(int w, int h) {
static
static void PrintRect(int w, int h) {
int i, j;
int i, j;
for (i = 0; i < h; i++) {
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
for (j = 0; j < w; j++) {
Console.Write('*');
Console.Write('*');
}
}
Console.WriteLine();
Console.WriteLine();
}
}
}
}
17. 犖ム険犖 犖犖÷賢犖
犢犖犖朽権犖犢犖÷犢犖犖 DrawLine
犖犖園犖犖迦牽犖迦検犖巌犖犖犖犢犖犖犖謹犖犖園硯: int len
犢
犢犖÷犖÷犖迦牽犖犢犖犖犖劇犖犢犖迦犖 犢
犖
犖о顕犖犢犖犢犖犖犖犖犖犢犖о権 len '* '
using System;
using System;
class Quiz {{
class Quiz
static void Main() {{
static void Main()
DrawLine(10);
DrawLine(10);
}}
犢犖犢犢 犖÷犢犖 犖 DrawLine 犖犖犖犖犖朽...
}}
犢犖犖犢犖犖犖÷犢犖迦犖犢犖犖犢犖犖犢犖犖犖犖犖ム献犖園犖犢犢犖犢犖