#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int count = 0;
// Lambda callback captures count by reference and increments it
auto callback = [&count]() {
count++;
};
for (int i = 0; i < n; i++) {
callback();
}
cout << count;
return 0;
}Explanation & Logic Summary
count is captured by reference.auto allows the compiler to infer the lambda’s type safely.count by one.n times, the final value of count is printed.Firmware Relevance & Real-World Context
auto) avoids verbose and non-portable callback declarations.
Input
0
Expected Output
0