2020-09-20から1日間の記事一覧

階乗計算 サンプル @Rust

fn main() { use std::io; let mut input = String::new(); io::stdin().read_line(&mut input); input.pop(); let mut n: i32 = input.parse().unwrap(); let mut res = 1; loop { res *= n; n -= 1; if n == 0 { break; } } println!("{}! = {}", input, r…

おうむ返しサンプル @Haskell

--echo.hs main = do input <- getLine putStrLn(input)stack ghc echo.hs ./echo hello >>hello

Main基本 @C

#include <stdio.h> int main(int argc, char *argv[]) { for (int i = 0; i < argc; i++) { printf("%s\n", argv[i]); } return 0; } gcc -o main main.c ./main hello world ! >>hello >>world >>!</stdio.h>