ציטוט:
נכתב במקור על ידי Matchs
אני לומד C# כבר חצי שעה, וכרגע בניתי מחשבון בדיוק למה שאתה רוצה..
הינה הדוגמה, תמשיך כמו שאתה יודע:
PHP קוד:
int A;
int B;
char C;
Console.WriteLine("Welcome to C# calculator!");
Console.WriteLine("Made by Rotem the programmer :P");
Console.WriteLine();
Console.Write("Please insert the first number: ");
A = int.Parse(Console.ReadLine());
Console.Write("Please insert the second number: ");
B = int.Parse(Console.ReadLine());
Console.Write("Please insert an action: ");
C = char.Parse(Console.ReadLine());
switch(C)
{
case '+':
Console.WriteLine("The Result: {0} {1} {2} = {3}", A, C, B, A+B);
Console.Read();
break;
}
|
תודה רבה!
אבל זה לא נותן לי כלום בלי הסברים חח
אפשר טיפה הסברים איך להשתמש ב case?
וןלפי מה שהבנתי זה רק חיבור :\