よじろめ覚書

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

ABC053B - A to Z String

問題:B - A to Z String

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

int main(void) {
    string s;

    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> s;
    cout << s.rfind('Z') - s.find('A') + 1 << "\n";
    return 0;
}