Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int x[100][2],w[100][2],n;
bool cal[110];
int COU(int a,int b){
??while(true){
????if(a<2||b<2)return 1;
????if(a<b){int t=a;a=b,b=t;}
????a%=b;
????if(!a)return b;
??}
}
long long DFS(int q){
????????if(!q)return 1;
????????q--;
????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
}
int main(){
??while(true){
??cin>>n;
??if(!n)break;
??for(int i=0;i<n;i++)cal[i]=false;
??for(int i=0;i<n;i++){
????cin>>x[i][0]>>x[i][1]>>w[i][0]>>w[i][1];
????cal[w[i][0]-1]=true,cal[w[i][1]-1]=true;
??}
??for(int i=0;i<n;i++)if(!cal[i])cout<<DFS(i+1)<<endl;
??}
??return 0;
}

Compiler output:
a.cc: In function 'int COU(int, int)':
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ??while(true){
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ??while(true){
      |  ^
a.cc:7:3: error: expected primary-expression before 'while'
    7 | ??while(true){
      |   ^~~~~
a.cc:7:3: error: expected ':' before 'while'
    7 | ??while(true){
      |   ^~~~~
      |   :
a.cc:7:3: error: expected primary-expression before 'while'
    7 | ??while(true){
      |   ^~~~~
a.cc:7:3: error: expected ':' before 'while'
    7 | ??while(true){
      |   ^~~~~
      |   :
a.cc:7:3: error: expected primary-expression before 'while'
    7 | ??while(true){
      |   ^~~~~
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'long long int DFS(int)':
a.cc:15:1: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      | ^
a.cc:15:2: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |  ^
a.cc:15:3: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |   ^
a.cc:15:4: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |    ^
a.cc:15:5: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |     ^
a.cc:15:6: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |      ^
a.cc:15:7: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |       ^
a.cc:15:8: error: expected primary-expression before '?' token
   15 | ????????if(!q)return 1;
      |        ^
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:15:9: error: expected ':' before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
      |         :
a.cc:15:9: error: expected primary-expression before 'if'
   15 | ????????if(!q)return 1;
      |         ^~
a.cc:16:1: error: expected primary-expression before '?' token
   16 | ????????q--;
      | ^
a.cc:16:2: error: expected primary-expression before '?' token
   16 | ????????q--;
      |  ^
a.cc:16:3: error: expected primary-expression before '?' token
   16 | ????????q--;
      |   ^
a.cc:16:4: error: expected primary-expression before '?' token
   16 | ????????q--;
      |    ^
a.cc:16:5: error: expected primary-expression before '?' token
   16 | ????????q--;
      |     ^
a.cc:16:6: error: expected primary-expression before '?' token
   16 | ????????q--;
      |      ^
a.cc:16:7: error: expected primary-expression before '?' token
   16 | ????????q--;
      |       ^
a.cc:16:8: error: expected primary-expression before '?' token
   16 | ????????q--;
      |        ^
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:16:12: error: expected ':' before ';' token
   16 | ????????q--;
      |            ^
      |            :
a.cc:16:12: error: expected primary-expression before ';' token
a.cc:17:1: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      | ^
a.cc:17:2: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |  ^
a.cc:17:3: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |   ^
a.cc:17:4: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |    ^
a.cc:17:5: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |     ^
a.cc:17:6: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |      ^
a.cc:17:7: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |       ^
a.cc:17:8: error: expected primary-expression before '?' token
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |        ^
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:17:9: error: expected ':' before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
      |         :
a.cc:17:9: error: expected primary-expression before 'long'
   17 | ????????long long a=DFS(w[q][0]),b=DFS(w[q][1]);
      |         ^~~~
a.cc:18:1: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      | ^
a.cc:18:2: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      |  ^
a.cc:18:3: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      |   ^
a.cc:18:4: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      |    ^
a.cc:18:5: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      |     ^
a.cc:18:6: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))/COU(a*x[q][0],b*x[q][1]);
      |      ^
a.cc:18:7: error: expected primary-expression before '?' token
   18 | ????????return (a*b*(x[q][0]+x[q][1]))