当前位置:网站首页>2020-11-07
2020-11-07
2020-11-10 10:41:00 【I'm sorry.】
Application C# Language
1. seek π/2 The formula of the approximate value of :
π/2=2/12/34/3*…2n/2n-12n/2n+1, Seeking the right n=1000 when π Approximate value
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
int n;
double pi=1;
for (n = 1; n <= 1000; n++)
{
pi=pi*2*n/(2*n-1)*2*n/(2*n+1);
}
Console.WriteLine(" Output approximate value : " +2*pi);
}
}
}

2. Design a program , Enter a decimal number , Output the corresponding hexadecimal number
using System;
namespace jinzhizhuanhuan
{
class Program
{
private static string result;
static void Main(string[] args)
{
Console.WriteLine(" Please enter decimal number : ");
int m = int.Parse(Console.ReadLine());
String result= Convert.ToString(m, 16);
Console.WriteLine(" The hexadecimal number is : " );
Console.WriteLine(m.ToString("X"));
}
}
}

3. Find the array a The subscript of the maximum value in , Output subscript and maximum
using System;
namespace zuidazhix
{
class Program
{
static void Main(string[] args)
{
int max;
int i;
int j;
int[] her = new int[] {
89, 23, 45, 34, 34, 56, 6, 5, 9, 21 };
max = her[0];
for (i = 1; i < her.Length; i++)
{
if (her[i] > max)
{
max = her[i];
}
}
Console.WriteLine(" The maximum is : " + max);
for (j = 0; j < her.Length; j++)
{
if (her[j] == max) {
Console.WriteLine(" The subscript is : "+j);
}
}
}
}
}

版权声明
本文为[I'm sorry.]所创,转载请带上原文链接,感谢
边栏推荐
- Thinking about competitive programming: myths and shocking facts
- LeetCode:二叉树(四)
- CSDN bug8: to be added
- GNU assembly basic mathematical equations multiplication
- iOS14新特性-WidgetKit开发与实践
- One of the 10 Greatest formulas in the world is well known
- 港股上市公司移卡收购创信众42.5%股权 谋划加快营销服务布局
- Learning from scratch YoMo series: Opening
- jmeter接口测试--带有token的解决方法
- Harbor项目高手问答及赠书活动火热进行中
猜你喜欢

2020-11-07

On fedlearner, the latest open source federated machine learning platform of byte

Learning from scratch YoMo series: Opening

中小企业为什么要用CRM系统

吴恩达《Machine Learning》精炼笔记 4:神经网络基础 - 知乎

ElasticSearch 集群基本概念及常用操作汇总(建议收藏)

我手撸了一个划线翻译工具!

csdn bug1:待加
![[论文阅读笔记] Community-oriented attributed network embedding](/img/17/1d1989945d943ca3cd2a2b8a5731de.jpg)
[论文阅读笔记] Community-oriented attributed network embedding

leetcode1-两数之和
随机推荐
[elixir! 0073] beam built-in memory database ETS
After seven years of pursuing, nearly one billion US dollars of bitcoin was eventually confiscated and confiscated by the US government
CSDN BUG1: to be added
中小企业为什么要用CRM系统
微服务授权应该怎么做?
What does the mremote variable in servicemanagerproxy refer to?
csdn bug6:待加
【技术教程】C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
Only options request is sent, no post solution is sent
Enter C abstract to understand the similarities and differences between abstract classes and interfaces
layer.prompt(options, yes) - 输入层
Network security engineer Demo: original * * controls your server like this! (2)
csdn bug1:待加
C++ 标准库头文件
Filezilla server配置FTP服务器中的各种问题与解决方法
Harbor项目高手问答及赠书活动火热进行中
Factory approach model
如何看待阿里云成立新零售事业部?
竞争性编程的思考:那些神话和令人震惊的事实[图]
CSDN bug6: to be added