任务描述
本关任务:编写程序,从键盘输入两个整数,输出其和、差、积和商。
编程要求
根据提示,在右侧编辑器补充代码,计算并输出两个数的和、差、积、商。
测试说明
平台会对你编写的代码进行测试:
测试输入: 12 25 预期输出: 和:37,差:-13,积:300,商:0
测试输入: 5 1 预期输出: 和:6,差:4,积:5,商:5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ch301
{
class Program
{
static void Main(string[] args)
{
/******begin*******/
int num1;
int num2;
num1=int.Parse(Console.ReadLine());
num2=int.Parse(Console.ReadLine());
int a = num1 + num2;
int b = num1 - num2;
int c = num1 * num2;
int d = num1 / num2;
Console.WrintLine("a = {0},b = {1},c= {2},d = {3}",a,b,c,d);