题解 | #小乐乐求和#
小乐乐求和
https://www.nowcoder.com/practice/ce0b2eacd3d04647831358c2876e44ff
public class Program { public static void Main() { //(1+n)*(n/2) ulong num = ulong.Parse(System.Console.ReadLine()); ulong result = 0; while(num!=0) { result+=num; num--; } System.Console.WriteLine(result); } }