如何对罗马数字进行数学运算,这将仅使用C#在罗马语言中给出结果. [英] How to do mathematical operation on Roman numerals which will give results in Roman only using C# .

查看:133
本文介绍了如何对罗马数字进行数学运算,这将仅使用C#在罗马语言中给出结果.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为C#的新手,它总是好奇地学习它,因此我将获得更多的知识.

As a newbee into C# its always curious to learn it so I will get more knowledge.

但是在完成这段代码后,我坚持了这一点.

But I have stuck into this after doing this piece of code.

这是我的代码.

< -----代码---->

<-----Code---->

< ---最终代码--->

<---end code--->

推荐答案

不完全确定您要问什么!

Not entirely sure what you are asking!

您到目前为止所写的内容是否存在问题?

Is there an issue with what you have written so far?

还是只想扩展程序以对用户输入的某些数字执行一些数学运算?

Or you just want to extend your program to perform some mathematical operation on some numbers that the user inputs?

如果是最后一个,我的建议是-甚至不要尝试直接对罗马数字进行数学运算!这种形式的数字表示形式并不适合大多数数学,这就是为什么现在世界上大多数地区都使用阿拉伯数字!

If its the last one, my advice would be - don't even try and do mathematical operations directly on the roman numerals! That form of numerical representation doesn't lend itself to most maths, which is why most of the world now use Arabic numbers!

相反,只需保留用户输入的int类型即可.对这些值执行所需的任何数学运算,然后仅在需要显示结果时才转换为罗马数字.

Instead, just keep hold of the user's input as int types. Perform whatever mathematical operations you need to do on these values, and then only convert to Roman numerals when you need to display the results.


这篇关于如何对罗马数字进行数学运算,这将仅使用C#在罗马语言中给出结果.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆