Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
lala
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int count=0; int searchnum=Int32.Parse(Console.ReadLine()); int arraylen=Int32.Parse(Console.ReadLine()); int [] array=new int[arraylen]; for(int i=0;i<arraylen;i++) { array[i]= Int32.Parse(Console.ReadLine()); if(array[i]==searchnum) {count++;} } if (count>0) Console.WriteLine("Number Found"); else Console.WriteLine("Number Not Found"); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
convert a string of numbers to a list then use a forEach to loop through the list
biswa
Recur6
BaseUrl test
Enumeration
asxsd dxsd
Why do my posts keep getting deleted?
Int number to String Array
dfghdfh
Enumerable expansion
Please log in to post a comment.