Skip to content

Instantly share code, notes, and snippets.

@dzsquared
Created December 30, 2016 02:44
Show Gist options
  • Save dzsquared/02ff8c0742630e1ef630b526815710f1 to your computer and use it in GitHub Desktop.
Save dzsquared/02ff8c0742630e1ef630b526815710f1 to your computer and use it in GitHub Desktop.
intro to sorting created by dzsquared - https://repl.it/Ex6a/0
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int findMe = Convert.ToInt32(Console.ReadLine());
int arraySize = Convert.ToInt32(Console.ReadLine());
int foundHere = 0;
string[] findHere = Console.ReadLine().Split(' ');
for(int i = 0; i < arraySize; i++) {
if(Convert.ToInt32(findHere[i]) == findMe) {
foundHere = i;
}
}
Console.WriteLine(foundHere);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment