Skip to content

Exemplo Rust Lang_300820 #76125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gersonpas opened this issue Aug 30, 2020 · 0 comments
Closed

Exemplo Rust Lang_300820 #76125

gersonpas opened this issue Aug 30, 2020 · 0 comments

Comments

@gersonpas
Copy link

#[allow(unused_variables)]
fn soma(a:u64, b:u64) -> u64{
    a + b
}
fn mult(a:u64, b:u64) -> u64{
    return a * b; // não é comum
}
fn main() {
    let name = "Gerson";
    let age: i32 = 58;
    println!("=====================================");
    println!("Hello, world!");
    println!("Estou aprendendo Rust!");
    println!("Meu nome é {name} e minha idade é {age}", name=name, age=age);
    println!("O resultado de 3 + 5 é: {}", 3 + 5);
    
    println!("====================================");
    
}

(Playground)

Output:

=====================================
Hello, world!
Estou aprendendo Rust!
Meu nome é Gerson e minha idade é 58
O resultado de 3 + 5 é: 8
====================================

Errors:

   Compiling playground v0.0.1 (/playground)
    Finished dev [unoptimized + debuginfo] target(s) in 0.84s
     Running `target/debug/playground`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants