jupyter notebook 결정

    

jupyter 에서 js c++한번에 쓰려고 


이렇게 하기로 했다


# html작성

이거 타이틀 꾸밀때 좋을듯


```html

%%html

<div class="good">hello world</div>

<style>

.good{

    color:red;

    background-color:blue;

}

</style>

```


# c++은 bash로 파일 만들어서 실행. (상당히 느림)

```html

%%bash

# C++ 소스 코드 파일 작성

echo '#include <iostream>

int main() {

    std::cout << "Hello, World!" << std::endl;

    return 0;

}' > hello.cpp


# C++ 코드 컴파일

g++ hello.cpp -o hello


# 실행 파일 실행

./hello

```


# js

```html

%%javascript

// JavaScript 코드를 작성

let arr = [1, 2, 3, 4, 5];

let sum = arr.reduce((acc, val) => acc + val, 0);

console.log("Sum:", sum);


// 결과를 문서에 표시

let output = `The sum of the array is: ${sum}`;

element.text(output);

```





댓글

이 블로그의 인기 게시물

js 스트링에서 요소 갯수 세기

STUDY

javascript cheatsheet