// ClassLibrary1.h
#include<iostream>
#pragma once

using namespace System;

namespace ClassLibrary1 {

    public ref class Class1
    {
        // TODO:  在此处添加此类的方法。
    public:
        static int ReadInt()
        {
            int i=0;
            std::cin >> i;
            return i;
        }
    };
}

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ClassLibrary1;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = 0, b = 0, c = 0;
            a = Class1.ReadInt();
            b = Class1.ReadInt();
            c = a + b;
            Console.WriteLine(a.ToString() + " + " + b.ToString() +" = "+ c.ToString());
            Console.ReadKey();
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-06-16
猜你喜欢
  • 2021-11-23
  • 2021-07-18
  • 2022-12-23
  • 2021-09-11
  • 2022-03-03
  • 2022-12-23
相关资源
相似解决方案