如果声明 [英] IF Statements

查看:132
本文介绍了如果声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码的部分视图。

展开 | 选择 | Wrap | 行号

解决方案

发布代码时请使用代码标签。


只有7种组合可以产生完美的正方形。您可以测试每个案例,也可以采用sqaure根结果,乘以100并取得其中的mod。如果mod是0,那么它就是一个完美的正方形。


请注意,第二种方法虽然更简单,但只能在你所列出的参数范围内准确。 / blockquote>

请描述您对完美方块的理解以及如何识别方形。用语言表达 - 我们稍后会担心软件。


你的意思是代码标签。我之前从未使用过这个网站。遗憾。

Heres a partial view of my code.

Expand|Select|Wrap|Line Numbers

解决方案

Please use code tags when posting code.

There''s only 7 combinations that result in a perfect square. You can either test for each case or you can take the sqaure rooted result, multiply by 100 and take the mod of that. If the mod is 0, then it''s a perfect square.

Note that the second method, while simpler, is only accurate within the confines of the parameters that you laid out.


Please describe your understanding of what a perfect square is and how you might recognize one. Just express this in words -- we''ll worry about software later.


What do you mean code tags. I never used this site before. Sorry.


这篇关于如果声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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