func_code_string: #include <bits/stdc++.h>   using namespace std;   int max_of_num;   int n, test_Q, point_num[100005], f_delp[100005][2];   vector<int> vc[100005];   bool flag = false;   void search1(int u, int fa) {     for (int i = 0; i < vc[u].size(); i++) {       int v = vc[u][i];       if (v != fa) {         if (point_num[v] == 1) {           if (f_delp[u][0]) {             flag = true;           }           f_delp[u][1] = true;         } else {           search1(v, u);           if (f_delp[v][1] && f_delp[u][1]) {             flag = true;           }           if (f_delp[v][0] && f_delp[u][0]) {             flag = true;           }           f_delp[u][0] = f_delp[u][0] | f_delp[v][1];           f_delp[u][1] = f_delp[u][1] | f_delp[v][0];         }       }     }   }   void connect_add(int u = 0, int v = 0) {     scanf( %d%d , &u, &v);     point_num[u]++;     point_num[v]++;     vc[u].push_back(v);     vc[v].push_back(u);   }   void search2(int u, int fa) {     int qaq = 0;     for (int i = 0; i < vc[u].size(); i++) {       int v = vc[u][i];       if (v != fa) {         if (point_num[v] == 1)           qaq++;         else           search2(v, u);       }     }     if (qaq) max_of_num = max_of_num - (qaq - 1);   }   int main() {     scanf( %d , &n);     for (int i = 2; i <= n; i++) {       connect_add();     }     test_Q = 0;     for (int i = 1; i <= n; ++i) {       if (point_num[i] > 1) {         test_Q = i;       }     }     search1(test_Q, 0);     if (flag) {       printf( 3  );     } else {       printf( 1  );     }     max_of_num = n - 1;     search2(test_Q, 0);     printf( %d n , max_of_num);     return 0;   }   