|
|
|||||||
| Home | Register | Downloads | FAQ | Members List | Calendar | Arcade | Mark Forums Read |
» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
បងស្រលាញ់អូន!
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jul 2005
Location: ព្រះរាជាណាចក្រកម្ពុជា
Posts: 4,117
|
Post the code written by you thread. :D
After i learn C# for two weeks here is my first try. ![]() What it do is: it ask 1+2=? if you answer 3 it gives "Congrategulation you are right" if not it ask you to continue:Y or N if press Y it return to 1+2=? again if you press other later than Y and N it return to Y or N. ![]() Code:
char b;
int a;
begin:
Console.WriteLine("1+2=?");
a=Int32.Parse(Console.ReadLine());
switch (a)
{case 3:
Console.WriteLine("Congrategulation you are right");break;
default:
Console.WriteLine("wrong");break;}
Console.WriteLine("Y or N");
b=char.Parse(Console.ReadLine());
continue1:
switch(b)
{case 'Y':
goto begin;
case 'N':
Console.WriteLine("bye"); break;
default:
goto continue1;
break;
Console.WriteLine("Only Y and N is inputed");
}
|
|
|
|
| Advertisement | [Remove Advertisement] | ||
|
| Thread Tools | |
| Display Modes | |
|
|