U E D R , A S I H C RSS

최소정수의합/송지훈

~cpp
find = [n+1|n <- [1..], (n*(n+1)/2) <= 3000 <= ((n+1)*(n+2)/2)]


=> n , n n+1 3000

한 n+1 .

한 haskell ...

...

...
-> 파 , . (<=) 함수가 어떤 전달인자를 받는지 알아보세요.
while haskell while ?
-> while 함 ..

C C++ ?
----
Haskell ?ㅋㅋ 합/택2 .
----

C++ .


~cpp
#include <iostream>

using std::cout;
using std::endl;

int main()
{
	int sum = 0, integer = 1;

	while(sum <= 3000)
	{
		sum = sum + integer;
		integer++;
	}
	cout << "The smallest 'n' for making the number what we want" << endl;
	cout << "-->" << integer << endl;
	cout << "Total sum is " << sum << endl;

	return 0;
}

9/24
(|) .
~cpp
little_sum (x:xs) y
 |y <= 0 = 0
 |otherwise = x + little_sum xs (y-x)



...-_-;
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:16
Processing time 0.0110 sec