Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

C Sharp/Input-Output #62

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"filename": "input-output",
"languages": [
"C++",
"C Sharp",
"Go",
"Java",
"Javascript",
Expand Down Expand Up @@ -143,6 +144,7 @@
"filename": "treeset",
"languages": [
"C++",
"C Sharp",
"Java",
"Ruby"
]
Expand All @@ -153,6 +155,7 @@
"filename": "treemap",
"languages": [
"C++",
"C Sharp",
"Java"
]
},
Expand Down
8 changes: 8 additions & 0 deletions langs/C Sharp/input-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//Entrada de datos
Console.Read(); //Lee un caracter o numero (tecla)
Console.ReadKey(); //Lee una tecla
Console.ReadLine(); //Lee una linea de texto

//Salida de datos
Console.Write("Sin salto de lineas");
Console.WriteLine ("Con salto de lineas");
20 changes: 20 additions & 0 deletions langs/C Sharp/treemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//Hay dos tipos de estructuras similares a los treemap

SortedDictionary <int,string> dicc = new SortedDictionary<int, string> (); //Clave - Valor
dicc.Add (1, "junay"); //Inserta un par Clave-Valor
dicc.ContainsKey (1); //Verifica si existe la Clave (Booleano)
dicc.ContainsValue ("junay"); //Verifica si existe el Valor (Booleano)
dicc.Remove (1); //Elimina una Clave-Valor segun la Clave
dicc.Clear (); //Limpia la estructura
dicc.Count; //Obtiene el tamaño

SortedList<int,string> dicc1 = new SortedList<int, string> ();
dicc1.Add (1, "michael"); //Inserta un par Clave-Valor
dicc1.ContainsKey (1); //Verifica si existe la Clave (Booleano)
dicc1.ContainsValue ("michael"); //Verifica si existe el Valor (Booleano)
dicc1.Remove (1); //Elimina una Clave-Valor segun la Clave
dicc1.Clear (); //Limpia la estructura
dicc1.Count; //Obtiene el tamaño
dicc1.RemoveAt(0); //Elimina una Clave-Valor segun el indice
dicc1.IndexOfKey (1); //Obtiene el indice de una Clave-Valor segun la Clave
dicc1.IndexOfValue ("michael"); //Obtiene el indice de una Clave-Valor segun el Valor
6 changes: 6 additions & 0 deletions langs/C Sharp/treeset
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SortedSet<int> valores = new SortedSet<int> (); //Creamos la estructura
valores.Add (1); //Agrega elementos
valores.Contains (1); //Verifica si un elemento existe
valores.Remove (1); //Elimina un elemento
valores.Clear (); //Limpia la estructura
valores.Count; //Obtiene el tamaño