```python
# /// intent
# goal   = "Print the names of the functions defined in the .cpp files under src, sorted."
# reads  = ["data/config.json", "data/rows.jsonl", "logs/app.log", "notes.md", "registry.cpp", "src/a.cpp", "src/b.cpp", "src/c.cpp", "src/util.h"]
# writes = []
# output = "printed"
# ///

import re
from pathlib import Path


def find_functions_in_file(filepath):
    names = []
    text = Path(filepath).read_text()
    for line in text.splitlines():
        match = re.match(r'^int\s+(\w+)\(', line)
        if match:
            names.append(match.group(1))
    return names


def main():
    paths = sorted(Path("src").glob("*.cpp"))
    all_names = []
    for p in paths:
        names = find_functions_in_file(p)
        all_names.extend(names)
    for name in sorted(all_names):
        print(name)


main()
```