SlideShare a Scribd company logo
1 of 9
 Өгөгдсөн тоог хөрвүүлэх
namespace ConsoleApplication32
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
string k = "";
int j = s.Length-1;
for (int i = 0; i < s.Length; i++)
{
k=k.Insert(i,s.Substring(j, 1));
j--;
}
Console.WriteLine(k);
Console.ReadLine();
}
}
}
 Өгөгдсөн тоо палиндром тоо эсэх
namespace ConsoleApplication32
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
string k = "";
int j = s.Length-1;
for (int i = 0; i < s.Length; i++)
{
k=k.Insert(i,s.Substring(j, 1));
j--;
}
if (int.Parse(s) == int.Parse(k))
Console.WriteLine("palindrom mon");
else
Console.WriteLine("palindrom bish");
Console.ReadLine();
}
}
}
 Өгөгдсөн тоо тэгш эсвэл сондгой эсэхийг тодорхойлох
namespace ConsoleApplication34
{
class Program
{
static void Main(string[] args)
{
double m = double.Parse(Console.ReadLine());
string s=Convert.ToString(m/2);
if (s.Contains("."))
Console.WriteLine("sondgoi");
else
Console.WriteLine("tegsh");
Console.ReadLine();
}
}
}
 Өгөгдсөн тооны цифрийн нийлбэр тэгш эсвэл сондгой эсэхийг тодорхойлох
namespace ConsoleApplication40
{
class Program
{
static void Main(string[] args)
{
Console.Write("too oruul=");
string m = Console.ReadLine();
double s = 0;
for (int i = 0; i < m.Length; i++)
s += double.Parse(m.Substring(i,1));
string k = Convert.ToString(s / 2);
if (k.Contains("."))
Console.WriteLine("tsifriin niilber {0}, sondgoi too",s );
else
Console.WriteLine("tsifriin niilber {0}, tegsh too", s);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивын элементүүдийг хөрвүүлж b[1],b[2],b[3],… b[n] массивт хий.
namespace ConsoleApplication35
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
int[] b = new int[100];
Console.Write("a massiviin elementiin too:=");
int n =int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int t = n;
for (int i = 1; i <= n; i++)
{
b[i] = a[t];
t--;
}
for (int i = 1; i <= n; i++)
Console.WriteLine("b[{0}]:={1}", i, b[i]);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивын элементүүдийг багаас нь ихрүү өсөх дарааллаар эрэмбэл.
namespace ConsoleApplication36
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
Console.Write("a massiviin elementiin too:=");
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int k=0;
for (int i = 1; i < n; i++)
for (int j = i+1; j <= n; j++)
if (a[i] > a[j])
{
k = a[i];
a[i] = a[j];
a[j] = k;
}
for (int i = 1; i <= n; i++)
Console.WriteLine("a[{0}]:={1}", i, a[i]);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массиваас хамгийн их утгыг ол.
namespace ConsoleApplication37
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
Console.Write("a massiviin elementiin too:=");
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int max = a[1];
for (int i = 2; i <= n; i++)
if (max < a[i])
max = a[i];
Console.WriteLine("hamgiin ih utga n: {0} ", max);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт хамгийн их элемент хаана байгааг ол.
namespace ConsoleApplication37
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
Console.Write("a massiviin elementiin too:=");
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int max = a[1];
int j=1;
for (int i = 2; i <= n; i++)
if (max < a[i])
{
max = a[i];
j = i;
}
Console.WriteLine("hamgiin ih utga n: a[{0}]={1}", j, max);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт m тоо хэдэн ширхэг байгааг тоол.
namespace ConsoleApplication39
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
Console.Write("a massiviin elementiin too:=");
int n = int.Parse(Console.ReadLine());
Console.Write("tentsuu too:=");
int m = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int t=0;
for (int i = 1; i <= n; i++)
if (a[i] == m)
t++;
Console.WriteLine("{0} too {1} shirheg bn,",m,t);
Console.ReadLine();
}
}
}
 Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт хамгийн их элемент хаана хаана, хэдэн ширхэг байгааг тодорхойл.
namespace ConsoleApplication37
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[100];
Console.Write("a massiviin elementiin too:=");
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
Console.Write("a[{0}]:=", i);
a[i] = int.Parse(Console.ReadLine());
}
int max = a[1];
for (int i = 2; i <= n; i++)
if (max < a[i])
max = a[i];
Console.WriteLine("hamgiin ih utga n: {0} ", max);
int t = 0;
for (int i = 1; i <= n; i++)
if (max == a[i])
{
t++;
Console.WriteLine("a[{0}] ", i);
}
Console.WriteLine(" {0} shirheg bn. ", t);
Console.ReadLine();
}
}
}
namespace ConsoleApplication41
{
class Program
{
static void Main(string[] args)
{
Console.Write("Ortsnii toog oruul= ");
int orts = int.Parse(Console.ReadLine());
Console.Write("Davhariin toog oruul= ");
int Floor = int.Parse(Console.ReadLine());
Console.Write("Haalagnii dugaar oruul= ");
int DoorNumber = int.Parse(Console.ReadLine());
int t = 1;
for (int i=1; i<=orts; i++)
for (int j=1; j<=Floor; j++)
for (int l = 1; l <= 3; l++)
{
if (DoorNumber == t)
switch (l)
{
case 1:
Console.WriteLine("{0}-r orts, {1}-r Davhar, zuun haalga.", i, j, l);
break;
case 2:
Console.WriteLine("{0}-r orts, {1}-r Davhar, goliin haalga.", i, j, l);
break;
case 3:
Console.WriteLine("{0}-r orts, {1}-r Davhar, baruun haalga.", i, j, l);
break;
}
t++;
}
Console.ReadLine();
}
}
}

More Related Content

What's hot

matrix operation using operator overloading
matrix operation using operator overloadingmatrix operation using operator overloading
matrix operation using operator overloadingmaria azam
 
Media12132
Media12132Media12132
Media12132htmrk
 
Looping
LoopingLooping
LoopingThryo
 
program data rawat inap sederhana
program data rawat inap sederhanaprogram data rawat inap sederhana
program data rawat inap sederhanaEghan Jaya
 
Tablas hash (Rubén Ndong Obiang)
Tablas hash (Rubén Ndong Obiang)Tablas hash (Rubén Ndong Obiang)
Tablas hash (Rubén Ndong Obiang)edi.euitio
 

What's hot (9)

Programs
ProgramsPrograms
Programs
 
Programs
ProgramsPrograms
Programs
 
matrix operation using operator overloading
matrix operation using operator overloadingmatrix operation using operator overloading
matrix operation using operator overloading
 
Media12132
Media12132Media12132
Media12132
 
Prueba de montecarlo
Prueba de montecarloPrueba de montecarlo
Prueba de montecarlo
 
Recursion prog (1)
Recursion prog (1)Recursion prog (1)
Recursion prog (1)
 
Looping
LoopingLooping
Looping
 
program data rawat inap sederhana
program data rawat inap sederhanaprogram data rawat inap sederhana
program data rawat inap sederhana
 
Tablas hash (Rubén Ndong Obiang)
Tablas hash (Rubén Ndong Obiang)Tablas hash (Rubén Ndong Obiang)
Tablas hash (Rubén Ndong Obiang)
 

Viewers also liked

квадрат тэгшитгэл
квадрат тэгшитгэлквадрат тэгшитгэл
квадрат тэгшитгэлch-boldbayar
 
Guia de estudio - sist. de igualacion , sustitucion y reduccion
Guia de estudio - sist. de igualacion , sustitucion y reduccionGuia de estudio - sist. de igualacion , sustitucion y reduccion
Guia de estudio - sist. de igualacion , sustitucion y reduccioncristianacuna
 
Introducción a la compilación en ambientes Unix.
Introducción a la compilación en ambientes Unix.Introducción a la compilación en ambientes Unix.
Introducción a la compilación en ambientes Unix.Luis Claudio Pérez Tato
 
A Multidimensional Classification of 55 Enterprise Architecture Frameworks
A Multidimensional Classification of 55 Enterprise Architecture FrameworksA Multidimensional Classification of 55 Enterprise Architecture Frameworks
A Multidimensional Classification of 55 Enterprise Architecture FrameworksCapgemini
 
Online marketing and Technology
Online marketing and TechnologyOnline marketing and Technology
Online marketing and TechnologyLumoLink
 
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...SlideTeam.net
 
Ipsos MORI Scotland: Public Opinion Monitor June 2012
Ipsos MORI Scotland: Public Opinion Monitor June 2012Ipsos MORI Scotland: Public Opinion Monitor June 2012
Ipsos MORI Scotland: Public Opinion Monitor June 2012Ipsos UK
 
Digital Marketing Analytics talk given at Southern New Hampshire University
Digital Marketing Analytics talk given at Southern New Hampshire UniversityDigital Marketing Analytics talk given at Southern New Hampshire University
Digital Marketing Analytics talk given at Southern New Hampshire UniversityLoren Foxx
 
Community Food Assessment: A Piece by Piece Approach
Community Food Assessment: A Piece by Piece ApproachCommunity Food Assessment: A Piece by Piece Approach
Community Food Assessment: A Piece by Piece Approachesheehancastro
 
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...Joel Oleson
 
Broadening the Scope of Nanopublications
Broadening the Scope of NanopublicationsBroadening the Scope of Nanopublications
Broadening the Scope of NanopublicationsTobias Kuhn
 
I silenzi di de magistris de magistris tace sul fratello -non me ne occupo io-
I silenzi di de magistris   de magistris tace sul fratello -non me ne occupo io-I silenzi di de magistris   de magistris tace sul fratello -non me ne occupo io-
I silenzi di de magistris de magistris tace sul fratello -non me ne occupo io-Daniela Petrecca
 

Viewers also liked (19)

квадрат тэгшитгэл
квадрат тэгшитгэлквадрат тэгшитгэл
квадрат тэгшитгэл
 
Guia de estudio - sist. de igualacion , sustitucion y reduccion
Guia de estudio - sist. de igualacion , sustitucion y reduccionGuia de estudio - sist. de igualacion , sustitucion y reduccion
Guia de estudio - sist. de igualacion , sustitucion y reduccion
 
Introducción a la compilación en ambientes Unix.
Introducción a la compilación en ambientes Unix.Introducción a la compilación en ambientes Unix.
Introducción a la compilación en ambientes Unix.
 
A Multidimensional Classification of 55 Enterprise Architecture Frameworks
A Multidimensional Classification of 55 Enterprise Architecture FrameworksA Multidimensional Classification of 55 Enterprise Architecture Frameworks
A Multidimensional Classification of 55 Enterprise Architecture Frameworks
 
Online marketing and Technology
Online marketing and TechnologyOnline marketing and Technology
Online marketing and Technology
 
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...
3 d pie chart circular with hole in center 11 stages powerpoint diagrams and ...
 
Ipsos MORI Scotland: Public Opinion Monitor June 2012
Ipsos MORI Scotland: Public Opinion Monitor June 2012Ipsos MORI Scotland: Public Opinion Monitor June 2012
Ipsos MORI Scotland: Public Opinion Monitor June 2012
 
Digital Marketing Analytics talk given at Southern New Hampshire University
Digital Marketing Analytics talk given at Southern New Hampshire UniversityDigital Marketing Analytics talk given at Southern New Hampshire University
Digital Marketing Analytics talk given at Southern New Hampshire University
 
Community Food Assessment: A Piece by Piece Approach
Community Food Assessment: A Piece by Piece ApproachCommunity Food Assessment: A Piece by Piece Approach
Community Food Assessment: A Piece by Piece Approach
 
Lead us
Lead usLead us
Lead us
 
Indicadores tercer periodo tecnologia
Indicadores tercer periodo tecnologiaIndicadores tercer periodo tecnologia
Indicadores tercer periodo tecnologia
 
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...
Boosting Productivity through Successful Engaging SharePoint Portals by Joel ...
 
Proceso de decisión markoviano
Proceso de decisión markovianoProceso de decisión markoviano
Proceso de decisión markoviano
 
Indicadores tercer periodo
Indicadores tercer periodoIndicadores tercer periodo
Indicadores tercer periodo
 
战略沙盘
战略沙盘战略沙盘
战略沙盘
 
Caitlin Woltje Resume
Caitlin Woltje ResumeCaitlin Woltje Resume
Caitlin Woltje Resume
 
Broadening the Scope of Nanopublications
Broadening the Scope of NanopublicationsBroadening the Scope of Nanopublications
Broadening the Scope of Nanopublications
 
I silenzi di de magistris de magistris tace sul fratello -non me ne occupo io-
I silenzi di de magistris   de magistris tace sul fratello -non me ne occupo io-I silenzi di de magistris   de magistris tace sul fratello -non me ne occupo io-
I silenzi di de magistris de magistris tace sul fratello -non me ne occupo io-
 
Europa sangría
Europa sangríaEuropa sangría
Europa sangría
 

More from orgil

Bodlogo
BodlogoBodlogo
Bodlogoorgil
 
Its150 l3
Its150 l3Its150 l3
Its150 l3orgil
 
Its150 l2
Its150 l2Its150 l2
Its150 l2orgil
 
Its150 l1
Its150 l1Its150 l1
Its150 l1orgil
 
Test
TestTest
Testorgil
 
Example excel2007
Example excel2007Example excel2007
Example excel2007orgil
 
Test7
Test7Test7
Test7orgil
 
Test6
Test6Test6
Test6orgil
 
Bodlogiin code
Bodlogiin codeBodlogiin code
Bodlogiin codeorgil
 
Its150 l10powerpoint2007
Its150 l10powerpoint2007Its150 l10powerpoint2007
Its150 l10powerpoint2007orgil
 
Its150 l10powerpoint2007
Its150 l10powerpoint2007Its150 l10powerpoint2007
Its150 l10powerpoint2007orgil
 
Test5
Test5Test5
Test5orgil
 
Test7
Test7Test7
Test7orgil
 
Test7
Test7Test7
Test7orgil
 
Test7
Test7Test7
Test7orgil
 
Test7
Test7Test7
Test7orgil
 
Test6
Test6Test6
Test6orgil
 
Test4
Test4Test4
Test4orgil
 
Test3
Test3Test3
Test3orgil
 

More from orgil (20)

Bodlogo
BodlogoBodlogo
Bodlogo
 
Its150 l3
Its150 l3Its150 l3
Its150 l3
 
Its150 l2
Its150 l2Its150 l2
Its150 l2
 
Its150 l1
Its150 l1Its150 l1
Its150 l1
 
Bd
BdBd
Bd
 
Test
TestTest
Test
 
Example excel2007
Example excel2007Example excel2007
Example excel2007
 
Test7
Test7Test7
Test7
 
Test6
Test6Test6
Test6
 
Bodlogiin code
Bodlogiin codeBodlogiin code
Bodlogiin code
 
Its150 l10powerpoint2007
Its150 l10powerpoint2007Its150 l10powerpoint2007
Its150 l10powerpoint2007
 
Its150 l10powerpoint2007
Its150 l10powerpoint2007Its150 l10powerpoint2007
Its150 l10powerpoint2007
 
Test5
Test5Test5
Test5
 
Test7
Test7Test7
Test7
 
Test7
Test7Test7
Test7
 
Test7
Test7Test7
Test7
 
Test7
Test7Test7
Test7
 
Test6
Test6Test6
Test6
 
Test4
Test4Test4
Test4
 
Test3
Test3Test3
Test3
 

Bodlogo

  • 1.  Өгөгдсөн тоог хөрвүүлэх namespace ConsoleApplication32 { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string k = ""; int j = s.Length-1; for (int i = 0; i < s.Length; i++) { k=k.Insert(i,s.Substring(j, 1)); j--; } Console.WriteLine(k); Console.ReadLine(); } } }  Өгөгдсөн тоо палиндром тоо эсэх namespace ConsoleApplication32 { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string k = ""; int j = s.Length-1; for (int i = 0; i < s.Length; i++) { k=k.Insert(i,s.Substring(j, 1)); j--; } if (int.Parse(s) == int.Parse(k)) Console.WriteLine("palindrom mon"); else
  • 2. Console.WriteLine("palindrom bish"); Console.ReadLine(); } } }  Өгөгдсөн тоо тэгш эсвэл сондгой эсэхийг тодорхойлох namespace ConsoleApplication34 { class Program { static void Main(string[] args) { double m = double.Parse(Console.ReadLine()); string s=Convert.ToString(m/2); if (s.Contains(".")) Console.WriteLine("sondgoi"); else Console.WriteLine("tegsh"); Console.ReadLine(); } } }  Өгөгдсөн тооны цифрийн нийлбэр тэгш эсвэл сондгой эсэхийг тодорхойлох namespace ConsoleApplication40 { class Program { static void Main(string[] args) { Console.Write("too oruul="); string m = Console.ReadLine(); double s = 0; for (int i = 0; i < m.Length; i++) s += double.Parse(m.Substring(i,1));
  • 3. string k = Convert.ToString(s / 2); if (k.Contains(".")) Console.WriteLine("tsifriin niilber {0}, sondgoi too",s ); else Console.WriteLine("tsifriin niilber {0}, tegsh too", s); Console.ReadLine(); } } }  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивын элементүүдийг хөрвүүлж b[1],b[2],b[3],… b[n] массивт хий. namespace ConsoleApplication35 { class Program { static void Main(string[] args) { int[] a = new int[100]; int[] b = new int[100]; Console.Write("a massiviin elementiin too:="); int n =int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); } int t = n; for (int i = 1; i <= n; i++) { b[i] = a[t]; t--; } for (int i = 1; i <= n; i++) Console.WriteLine("b[{0}]:={1}", i, b[i]); Console.ReadLine();
  • 4. } } }  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивын элементүүдийг багаас нь ихрүү өсөх дарааллаар эрэмбэл. namespace ConsoleApplication36 { class Program { static void Main(string[] args) { int[] a = new int[100]; Console.Write("a massiviin elementiin too:="); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); } int k=0; for (int i = 1; i < n; i++) for (int j = i+1; j <= n; j++) if (a[i] > a[j]) { k = a[i]; a[i] = a[j]; a[j] = k; } for (int i = 1; i <= n; i++) Console.WriteLine("a[{0}]:={1}", i, a[i]); Console.ReadLine(); } } }
  • 5.  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массиваас хамгийн их утгыг ол. namespace ConsoleApplication37 { class Program { static void Main(string[] args) { int[] a = new int[100]; Console.Write("a massiviin elementiin too:="); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); } int max = a[1]; for (int i = 2; i <= n; i++) if (max < a[i]) max = a[i]; Console.WriteLine("hamgiin ih utga n: {0} ", max); Console.ReadLine(); } } }  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт хамгийн их элемент хаана байгааг ол. namespace ConsoleApplication37 { class Program { static void Main(string[] args) { int[] a = new int[100]; Console.Write("a massiviin elementiin too:="); int n = int.Parse(Console.ReadLine());
  • 6. for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); } int max = a[1]; int j=1; for (int i = 2; i <= n; i++) if (max < a[i]) { max = a[i]; j = i; } Console.WriteLine("hamgiin ih utga n: a[{0}]={1}", j, max); Console.ReadLine(); } } }  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт m тоо хэдэн ширхэг байгааг тоол. namespace ConsoleApplication39 { class Program { static void Main(string[] args) { int[] a = new int[100]; Console.Write("a massiviin elementiin too:="); int n = int.Parse(Console.ReadLine()); Console.Write("tentsuu too:="); int m = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); }
  • 7. int t=0; for (int i = 1; i <= n; i++) if (a[i] == m) t++; Console.WriteLine("{0} too {1} shirheg bn,",m,t); Console.ReadLine(); } } }  Өгөгдсөн a[1],a[2],a[3],… a[n] нэг хэмжээст массивт хамгийн их элемент хаана хаана, хэдэн ширхэг байгааг тодорхойл. namespace ConsoleApplication37 { class Program { static void Main(string[] args) { int[] a = new int[100]; Console.Write("a massiviin elementiin too:="); int n = int.Parse(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.Write("a[{0}]:=", i); a[i] = int.Parse(Console.ReadLine()); } int max = a[1]; for (int i = 2; i <= n; i++) if (max < a[i]) max = a[i]; Console.WriteLine("hamgiin ih utga n: {0} ", max); int t = 0; for (int i = 1; i <= n; i++) if (max == a[i]) { t++;
  • 8. Console.WriteLine("a[{0}] ", i); } Console.WriteLine(" {0} shirheg bn. ", t); Console.ReadLine(); } } } namespace ConsoleApplication41 { class Program { static void Main(string[] args) { Console.Write("Ortsnii toog oruul= "); int orts = int.Parse(Console.ReadLine()); Console.Write("Davhariin toog oruul= "); int Floor = int.Parse(Console.ReadLine()); Console.Write("Haalagnii dugaar oruul= "); int DoorNumber = int.Parse(Console.ReadLine()); int t = 1; for (int i=1; i<=orts; i++) for (int j=1; j<=Floor; j++) for (int l = 1; l <= 3; l++) { if (DoorNumber == t) switch (l) { case 1: Console.WriteLine("{0}-r orts, {1}-r Davhar, zuun haalga.", i, j, l); break; case 2: Console.WriteLine("{0}-r orts, {1}-r Davhar, goliin haalga.", i, j, l); break; case 3: Console.WriteLine("{0}-r orts, {1}-r Davhar, baruun haalga.", i, j, l); break; }