- 分享
- 0
- 人气
- 0
- 主题
- 5
- 帖子
- 1042
- UID
- 105681
- 积分
- 3194
- 阅读权限
- 21
- 注册时间
- 2007-10-19
- 最后登录
- 2012-8-4
- 在线时间
- 753 小时
|
- #include<iostream.h>
- void main()
- {
- int num1, num2, sum;
- cout<<" Please enter the 1st number:"<<endl;
- cin<<num1;
- cout<<" Please enter the 2nd number:"<<endl;
- cin<<num2;
- sum=num1+num2;
- cout<<"The addiction for the both number u entered is "<<sum<<endl;
- cout<<""<<endl;
- }
复制代码
转换成C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int num1,num2,sum;
Console.WriteLine(" Please enter the 1st number:");
num1=Console.ReadLine();
Console.WriteLine(" Please enter 2nd number:");
num2=Console.ReadLine();
sum=num1+num2;
Console.WriteLine("The addiction for the both number u entered is "+sum);
}
}
}
em0012 |
|