trait Greet {
    fn greet(&self);
}

struct Person {
    name: String,
}

impl Greet for Person {
    fn greet(&self) {
        println!("こんにちは！ {} です！", self.name);
    }
}

struct Dog {
    name: String,
}

impl Greet for Dog {
    fn greet(&self) {
        println!("ワン！ {} だよ！", self.name);
    }
}

fn main() {
    let person = Person {
        name: String::from("なお"),
    };
    let dog = Dog {
        name: String::from("ポチ"),
    };

    person.greet();
    dog.greet();
}