您的位置:首页 > 编程语言 > C#

c#初学

2012-09-01 09:19 99 查看
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;
}
}
}
}
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c# class string