金子邦彦研究室プログラム例とヒントプログラミング入門とオンライン開発環境Python, Java, C プログラミングの体験(GDB online を使用)

Python, Java, C プログラミングの体験(GDB online を使用)

GDB online での実行結果例

GDB online は,Python 3, Java, C, C++, C#, JavaScript, R, アセンブリ言語, SQL, Ruby などに対応.コードアシスト, gdb の機能あり.

URL: http://www.onlinegdb.com/

※ お断り

特定の商用製品等を推奨、広報するものではない.使用感など評価を行うものでもない. 操作手順等について記述している

GDB online を使ってみる

  1. Web ページを開く

    http://www.onlinegdb.com/

  2. Languageのところで,使いたい言語を選ぶ

    [image]

    「Python 3」を選んだとして説明を続ける

  3. エディタでプログラムを編集し, 「Visual Execution」をクリック

    [image]
  4. 実行結果が表示されるので確認

    [image]

Python 3, Java, C の実行結果例

Python 3

x = [5, 4, 1, 3, 2]
for i in x:
    print(i * 120)

[image]

Java

public class Main {
    public static void main(String[] args) throws Exception {
        int x[] = {5, 4, 1, 3, 2};
        for (int i = 0; i < x.length; i++ ) {
            System.out.println(x[i] * 120);
        }
    }
}

[image]

C

#include<stdio.h>
int main(void){
    int i;
    int x[] = {5, 4, 1, 3, 2};
    for(i = 0; i < (sizeof(x)/sizeof(int)); i++) {
        printf("%d\n", x[i] * 120);
    }
}

[image]