#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <stdexcept>
#include <initializer_list>
using namespace std;
using string_arr = string[10];
string s[10] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
int odd[] = {1, 3, 5, 7};
int even[] = {0, 2, 4, 6};
string (&f())[10]
{
return s;
}
string_arr& f1() { return s; }
auto f2() -> string_arr&
{
return s;
}
decltype(s) &f3() { return s; }
decltype(odd) &g(int i)
{
return (i % 2) ? even : odd;
}
int main(int argc, char *argv[])
{
string (&x)[10] = f3();
int (&y)[4] = g(2);
for (const auto i : x) cout << i << " ";
cout << endl;
for (const auto i : y) cout << i << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y2N0eXBlPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPHN0ZGV4Y2VwdD4KI2luY2x1ZGUgPGluaXRpYWxpemVyX2xpc3Q+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdXNpbmcgc3RyaW5nX2FyciA9IHN0cmluZ1sxMF07CgpzdHJpbmcgc1sxMF0gPSB7ImEiLCAiYiIsICJjIiwgImQiLCAiZSIsICJmIiwgImciLCAiaCIsICJpIiwgImoifTsKaW50IG9kZFtdID0gezEsIDMsIDUsIDd9OwppbnQgZXZlbltdID0gezAsIDIsIDQsIDZ9OwoKc3RyaW5nICgmZigpKVsxMF0KewogICAgICAgIHJldHVybiBzOwp9CgpzdHJpbmdfYXJyJiBmMSgpIHsgcmV0dXJuIHM7IH0KCmF1dG8gZjIoKSAtPiBzdHJpbmdfYXJyJgp7CiAgICAgICAgcmV0dXJuIHM7Cn0KCmRlY2x0eXBlKHMpICZmMygpIHsgcmV0dXJuIHM7IH0KCmRlY2x0eXBlKG9kZCkgJmcoaW50IGkpCnsKICAgICAgICByZXR1cm4gKGkgJSAyKSA/IGV2ZW4gOiBvZGQ7Cn0KCgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqYXJndltdKQp7CiAgICAgICAgc3RyaW5nICgmeClbMTBdID0gZjMoKTsKICAgICAgICBpbnQgKCZ5KVs0XSA9IGcoMik7CgogICAgICAgIGZvciAoY29uc3QgYXV0byBpIDogeCkgY291dCA8PCBpIDw8ICIgIjsKICAgICAgICBjb3V0IDw8IGVuZGw7CiAgICAgICAgZm9yIChjb25zdCBhdXRvIGkgOiB5KSBjb3V0IDw8IGkgPDwgZW5kbDsKfQoK