RQNOJ 153数的计算(简单dfs)
#include <cstdio> #include <iostream> using namespace std; int ans; void dfs(int n) { for (int i=1; i<=n/2; ++i) { ++ans; dfs(i); } } int main() { int n; while (scanf("%d", &n) != EOF) { ans = 1; dfs(n); printf ("%d\n", ans); } return 0; }