5050

505050495051之間的自然數。5050為高斯9岁時,小学老师提出的難題:“自然数1100和”的答案。

5050
5049 5050 5051
数表整数

<< 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 >>

<< 5000 5010 5020 5030 5040 5050 5060 5070 5080 5090 >>

<< 5000 5100 5200 5300 5400 5500 5600 5700 5800 5900 >>

命名
數字5050
名稱5050
小寫五千零五十
大寫伍仟零伍拾
序數詞第五千零五十
five thousand fiftieth
識別
種類整數
性質
質因數分解2×52×101
表示方式
算筹
二進制1001110111010(2)
八進制11672(8)
十二進制2B0A(12)
十六進制13BA(16)

在數學上

梯形面積算法

參考

以下示例了如何利用计算从自然数1到100的和。

C語言

#include <stdio.h>

int main()
{
    int answer = 0;
    int i = 1;
    while (a <= 100)
    {
        answer = answer + i;
        i = i + 1;
    }
    printf ("%d\n", answer);
    return 0;
}

C++

#include <iostream>

using namespace std;

int main()
{
    int answer = 0;
    int i = 1;
    while (i <= 100)
    {
        answer = answer + i;
        i = i + 1;
    }
    cout << answer << endl;
    return 0;
}

C#

using System;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int answer = 0;
            int i = 1;
            while (i <= 100)
            {
                answer = answer + i;
                i = i + 1;
            }
            Console.WriteLine(answer);
        }
    }
}

JavaScript

<html>
<head>
<title>Looping</title>
</head>
<body>
<SCRIPT language="JavaScript">
<!--
    var answer = 0;
    var i = 1;
    while (i <= 100)
    {
        answer = answer + i;
        i = i + 1;
    }
    document.write(answer);
//-->
</SCRIPT>
</body>
</html>

Java

package hellojava.java;
public class JAVA 
{
	public static void main(String[] args) 
        {
		int answer = 0;
		for(int i =1;i<=100;i++)
                {
			answer = answer + i;
		}
		System.out.println(answer);
	}
}

MATLAB

i = 1;
answer = 0;
while i <= 100
    answer = answer + i;
    i = i + 1;
end
fprintf('%d\n',answer);

Python

answer = 0
for i in range(1,101):
    answer += i
print '%d' % answer

在人類文化上

  • 5050日本公車
  • 日本的東武5050系電車
  • 日本的東急5050系電車
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.