© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
10 replies
hanu

A way to get an integer input quickly?

Recently i'm trying to do competitive programming with C# and i'm curious if there's a way to get an (array of) integer input. The method I all know is this
// for an array of integers
int[] arrayInput = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray()
// for one integer
int singleInput = Int32.Parse(Console.ReadLine())
// for an array of integers
int[] arrayInput = Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray()
// for one integer
int singleInput = Int32.Parse(Console.ReadLine())
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Is there a way to name an object with an input?
C#CC# / help
3y ago
❔ Converting String to an integer with a Hexadecimal Value
C#CC# / help
3y ago
✅ Best way to get a response from an API
C#CC# / help
4y ago
❔ Unique Integer ID GEN from string input
C#CC# / help
3y ago