using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FirstHead
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter The Number");
int calcul = int.Parse(Console.ReadLine());
if (calcul < 10)
{
Console.WriteLine("you complexity of your number is {0}\nThe addition is{1}",1,calcul);
}
else if (calcul > 9 && calcul < 100)
{
int x, y;
x = calcul / 10;
y = calcul % 10;
Console.WriteLine("you complexity of your number is {0}\nThe addition is {1}", 2, x+y);
}
else if (calcul > 99 && calcul < 1000)
{
int x2 = calcul / 100;
switch (calcul % 100) {
case 0:
Console.WriteLine("you complexity of your number is {0}\nThe addition is{1}", 3, x2 );
break;
default:
int x1 = calcul / 100;
int x3 = calcul % 100;
int y1 = x3 % 10;
int y2 = x3 / 10;
Console.WriteLine("you complexity of your number is {0}\nThe addition is {1}", 3, x1+y1+y2);
break;
}
}
Console.ReadKey();
}
}
}
هذا ببرنامج السي شارب . وهو ناجح 100 % مع الأرقام من 0-----999
اذا اردت اي موضوع حول السي شارب يمكننني المساعدة قدر الامكان