よじろめ覚書

私の理解度重視のソースコードです。

ABC060A - Shiritori

問題:A - Shiritori

#include <iostream>
#include <string>
using namespace std;

int main(void) {
    string a, b, c;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a >> b >> c;
    cout << (a[a.length() -1] == b[0] && b[b.length() - 1] == c[0]? "YES" : "NO") << "\n";
    return 0;
}