C#基础 Math Pow Sqrt 幂与平方根
C#基础 Math Pow Sqrt 幂与平方根
2019年05月07日 20:42:51 心少朴 阅读数 27
版权声明:知识来源于智慧与善良并存的师傅们,亦当回报给智慧与善良并存的人们。 https://blog.csdn.net/yushaopu/article/details/89929028
- .NET Framework : 4.7.2
- IDE : Visual Studio Community 2019
- OS : Windows 10 x64
- typesetting : Markdown
- blog : blog.csdn.net/yushaopu
- github : github.com/GratefulHeartCoder
code
<span style="color:#000000"><code class="language-csharp"><span style="color:#a71d5d">using</span> System<span style="color:#969896">;</span>
<span style="color:#a71d5d">namespace</span> ConsoleApp
<span style="color:#969896">{</span>
<span style="color:#a71d5d">class</span> Program
<span style="color:#969896">{</span>
<span style="color:#a71d5d">static</span> <span style="color:#a71d5d">void</span> <span style="color:#795da3">Main</span><span style="color:#969896">(</span><span style="color:#a71d5d">string</span><span style="color:#969896">[</span><span style="color:#969896">]</span> args<span style="color:#969896">)</span>
<span style="color:#969896">{</span>
Console<span style="color:#969896">.</span><span style="color:#795da3">WriteLine</span><span style="color:#969896">(</span>Math<span style="color:#969896">.</span><span style="color:#795da3">Pow</span><span style="color:#969896">(</span><span style="color:#c76b29">2</span><span style="color:#969896">,</span> <span style="color:#c76b29">3</span><span style="color:#969896">)</span><span style="color:#969896">)</span><span style="color:#969896">;</span>
Console<span style="color:#969896">.</span><span style="color:#795da3">WriteLine</span><span style="color:#969896">(</span>Math<span style="color:#969896">.</span><span style="color:#795da3">Sqrt</span><span style="color:#969896">(</span><span style="color:#c76b29">2</span><span style="color:#969896">)</span><span style="color:#969896">)</span><span style="color:#969896">;</span>
Console<span style="color:#969896">.</span><span style="color:#795da3">ReadKey</span><span style="color:#969896">(</span><span style="color:#969896">)</span><span style="color:#969896">;</span>
<span style="color:#969896">}</span>
<span style="color:#969896">}</span>
<span style="color:#969896">}</span>
</code></span>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
result
<span style="color:#000000"><code class="language-bash">8
1.4142135623731
</code></span>
- 1
- 2
- 3
resource
- [文档] docs.microsoft.com/zh-cn/dotnet/csharp
- [规范] github.com/dotnet/docs/tree/master/docs/standard/design-guidelines
- [源码] referencesource.microsoft.com
- [平台] www.csdn.net
- [ IDE ] visualstudio.microsoft.com/zh-hans
- [.NET Core] dotnet.github.io
感恩曾经帮助过 心少朴 的人。
C#优秀,值得学习。.NET Core具有跨平台的能力,值得关注。
Console,WinForm,WPF,ASP.NET,Azure WebJob,WCF,Unity3d,UWP可以适当地了解。
注:此文是自学笔记所生,质量中下等,故要三思而后行。新手到此,不可照搬,应先研究其理象数,待能变通之时,自然跳出深坑。