金子邦彦研究室プログラム例とヒントプログラミング入門とオンライン開発環境Python3, Java, C, R, JavaScript, Ruby, Scheme, Bash の体験(paiza.IO を使用)

Python3, Java, C, R, JavaScript, Ruby, Scheme, Bash の体験(paiza.IO を使用)

paiza.IO での実行結果例

Python, C, Java, JavaScript, R の他にもSQL など多数の言語.表示は日本語. 一定の条件下でファイル操作も可能.

利用条件等は,利用者で確認すること.

お断り

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

paiza.IO を使ってみる

  1. Web ページを開く

    https://paiza.io/ja

  2. コード作成を試してみる」をクリック

    [image]
  3. メニューで,プログラミング言語を選ぶ

    [image]
  4. エディタでプログラムを編集し, 「実行」をクリック

    [image]
  5. 実行結果を確認

    [image]

    エディタでプログラムを変更して,何度でも実行できる.

Python3, Java, C, R, JavaScript, Ruby, Scheme, Bash の実行結果例

Python3

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]);
        }
    }
}

[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]

R

x <- c(5, 4, 1, 3, 2)
print(x * 120)

[image]

JavaScript

var x = [5, 4, 1, 3, 2]
for (var i=0; i<x.length; i++) {
    console.log(x[i] * 120);
}

[image]

Ruby

x = [5, 4, 1, 3, 2]
x.each do |i|
  print i * 120
  print ", "
end

[image]

Scheme

(print (map (lambda (x) (* x 120)) (list 5 4 1 3 2)) )

[image]

Bash

#!/bin/bash
for i in *; do
  echo $i
done

[image]