Y

@YSS

素数でclojure

Clojure
5 months ago
(def A (atom 1)) (def B1 (atom 0)) (def B2 (atom 0)) (def B3 (atom 0)) (def B4 (atom 0)) (while (< @A 121) (print @A) (reset! B1 (mod @A 2)) (reset! B2 (mod @A 3))

ソートでC 2

C
5 months ago
#include <stdio.h> #include <stdlib.h> int main() { int n = 5; int *a0 = malloc(n * sizeof(int)); *(a0 + 0) = 3; *(a0 + 1) = 2; *(a0 + 2) = 9; *(a0 + 3) = 9; *(a0 + 4) = 7;

BS

Python
5 months ago
P = [] Q = 0 G = [3,2,9,9,7] Haten = 0 while Q <16: P = G β = 1 while β < len(G):

博士式

C
5 months ago
#include <stdio.h> #include <stdlib.h> int main() { int *a0 = malloc(2 * sizeof(int)); *(a0 + 0) = 1; *(a0 + 1) = 1; int a1 = 0; int a2 = 0; printf("%d ",*(a0 + 0)); printf("%d ",*(a0 + 1));

aho

C
5 months ago
#include <stdio.h> int main() { int a = 1919810; printf(" %d",a); S: if (a != 1) { if (a % 2 == 0) { a = a / 2; } else {

x

Python
5 months ago
z = 0 def AP(э): result = э + 1 return result def AM(э): result = э - 1 return result def BP(э): result = э * 2 return result

o

Rust
5 months ago
fn eps(x: &[i32],y: i32) -> i32 { let mut b = 0; while b < x.len() { if x[b] == y{ return 1; } b += 1; } return 0; }

My

Rust
6 months ago
fn s(a:f64,b:i32) -> f64 { let mut th1 = 1.0; let mut th2 = 0.0; let mut th3 = 0.0; let mut k = 0; while k < b{ while th3 * th3 < a{ th2 = th3; th3 = th3 + th1; }

フィボナッチ数列

Rust
6 months ago
fn main() { let mut list = vec![1, 1]; let mut p = 2; let mut k; loop{ k = list[p-1]+list[p-2]; list.push(k); p += 1; if p >= 16 { break;

素数でSwift

Swift
6 months ago
var λ = 1 while λ < 121 { print(λ) if λ == 1 { print("→x") } else if λ % 2 == 0 && λ != 2{ print("→x") } else if λ % 3 == 0 && λ != 3{ print("→x")

H

Java
6 months ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { public static void main(String[] args) { int[] a0 = new int[2];

My

Java
6 months ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". class Main { static double S(int a, int b) { double th1 = 1.0,th2=0,th3=0,th4=0; for (int i = 0; i < b; i++) {

コブラ型

C
6 months ago
#include <stdio.h> #include <stdlib.h> struct Vector { int *data; // 実データ size_t size; // 使っている要素数 size_t cap; // 確保している容量 }; void vector_init(struct Vector *v) {

My

C
6 months ago
#include <stdio.h> double S(int A,int B); int main() { printf("%f",S(2,16)); return 0; } double S(int A,int B){ double th2=0,th3=0,th4=0; double th1 = 1.0;

フィボナッチ数列(蛇式)

C
6 months ago
#include <stdio.h> #include <stdlib.h> int *add(int *K, int y); int main() { printf("Hello world!\n"); int n = 2; int *a0 = malloc(n * sizeof(int)); *(a0 + 0) = 1; *(a0 + 1) = 1; int condition = 0;

フィボナッチ数列(南アフリカ式)

C
6 months ago
#include <stdio.h> #include <stdlib.h> int main() { int n = 2; int *a = malloc(n * sizeof *a); a[0] = 1; a[1] = 1; while (n < 16) { int old = n; n *= 2;

フィボナッチ数列(ハンマー式)

C
6 months ago
#include <stdio.h> #include <stdlib.h> int main() { int *a0 = malloc(16 * sizeof(int)); *(a0 + 0) = 1; *(a0 + 1) = 1; for (int i = 2; i < 16; i++) { *(a0 + (i-0)) = *(a0 + (i-1)) + *(a0 + (i-2)); } for (int n = 0; n <

フィボナッチ数列(ブーツ型)

C
6 months ago
#include <stdio.h> #include <stdlib.h> int main() { int *a0 = malloc(2 * sizeof(int)); *(a0 + 0) = 1; *(a0 + 1) = 1; int *a1 = malloc(4 * sizeof(int)); *(a1 + 0) = *(a0 + 0);

P

C
6 months ago
#include <stdio.h> void f(int *g, int a) {//戻り値なし *g = a; } int add(int g, int a) {//戻り値あり return g + a; } int main() { int k[10];

Python
6 months ago
import random def Eps(A,B): k = A for S in range(len(B)): if k == B[S]: result = 1 break else: