c#初学
来源:互联网 发布:逆光源网络剧全集资源 编辑:程序博客网 时间:2024/05/08 10:20
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication2{ class Program { static void Main(string[] args) { try { stu stu1 = new stu(); Console.WriteLine("hello word"); int s1, s2, z = 0; s1 = int.Parse(Console.ReadLine()); s2 = int.Parse(Console.ReadLine()); z = stu1.add(s1, s2); Console.WriteLine(z); } catch (IndexOutOfRangeException e) { Console.WriteLine("hello word"); } } public class stu { public int add(int x, int y) { return x + y; } } }}