This website is for preparing the Korean translation and should NOT confused with the Official Rust Website!

Rust é uma linguagem de programação de sistemas que roda incrivelmente rápido, previne segmentation faults, e garante segurança entre threads.
Mostre-me!

Versão recomendada:
1.12.0 (source)
Instalar Outros downloads

Apresentando

// Esse código é editável e rodável! fn main() { // Uma calculadora simples de inteiros: // `+` or `-` significa somar ou subtrair 1 // `*` or `/` significa multiplicar ou dividir por 2 let programa = "+ + * - /"; let mut acumulador = 0; for simbolo in programa.chars() { match simbolo { '+' => acumulador += 1, '-' => acumulador -= 1, '*' => acumulador *= 2, '/' => acumulador /= 2, _ => { // ignore todo o resto } } } println!("O programa \"{}\" gera o valor {}", programa, acumulador); }
fn main() {
// Uma calculadora simples de inteiros:
// `+` or `-` significa somar ou subtrair 1
// `*` or `/` significa multiplicar ou dividir por 2

let programa = "+ + * - /";
let mut acumulador = 0;

for simbolo in programa.chars() {
match simbolo {
    '+' => acumulador += 1,
    '-' => acumulador -= 1,
    '*' => acumulador *= 2,
    '/' => acumulador /= 2,
    _ => { /* ignore todo o resto */ }
}
}

println!("O programa \"{}\" gera o valor {}",
   programa, acumulador);
}