C#
Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
Output: Standard Output (stdout)
Memory limit: 100 megabytes
Time limit: 1.0 seconds
I/O and Documentation
- Your class (and project) must be called
Program. - You must have a
Mainmethod. - Use the
Console.ReadLine()function to get input. - Use the
Console.WriteLine()function to write output. - You are permitted to view Microsoft's C# Documentation during an NZIC contest.
Learn how to download .NET and use the dotnet command.
Example
Adding two numbers. Numbers will be space separated on a single line.
using System;
namespace Program
{
class Program
{
static void Main(string[] args)
{
string[] nums = Console.ReadLine().Split(' ');
int sum = Int32.Parse(nums[0]) + Int32.Parse(nums[1]);
Console.WriteLine(sum);
}
}
}
Submit
- Go to the submit tab and upload the addition program above by copy-pasting and selecting C# in the language dropdown.
- Understanding submission feedback.
Sample Explanation
3 + 4 = 7
-
Sample Input 1
3 4Sample Output 1
7