Language: C++

#include<bits/stdc++.h>
using namespace std;
int power(int n)
{
???int num=1;
???for(int i=0;i<n;i++)num*=10;
???return num;
}
int serch(int sum,int n)
{
???if(sum>21)return 0;
???else if(n==0)return sum;
???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
}
int main()
{
???string str;
???while(getline(cin,str)){
??????if(str[0]=='0')break;
??????int card[1000]={},co=0,point=0;
??????for(int i=0;;i++){
?????????if(str[i]==' '||str[i]=='\0'){
????????????for(int j=point;j<i;j++)card[co]+=(str[j]-'0')*power(i-1-j);
????????????co++;point=i+1;
?????????}
?????????if(str[i]=='\0')break;
??????}
??????int cou=0,sum=0;
??????for(int i=0;i<co;i++){
?????????if(card[i]==1)cou++;
?????????else if(card[i]<10)sum+=card[i];
?????????else sum+=10;
??????}
??????cout<<serch(sum,cou)<<endl;
???}
}

Compiler output:
a.cc: In function 'int power(int)':
a.cc:5:1: error: expected primary-expression before '?' token
    5 | ???int num=1;
      | ^
a.cc:5:2: error: expected primary-expression before '?' token
    5 | ???int num=1;
      |  ^
a.cc:5:3: error: expected primary-expression before '?' token
    5 | ???int num=1;
      |   ^
a.cc:5:4: error: expected primary-expression before 'int'
    5 | ???int num=1;
      |    ^~~
a.cc:5:4: error: expected ':' before 'int'
    5 | ???int num=1;
      |    ^~~
      |    :
a.cc:5:4: error: expected primary-expression before 'int'
    5 | ???int num=1;
      |    ^~~
a.cc:5:4: error: expected ':' before 'int'
    5 | ???int num=1;
      |    ^~~
      |    :
a.cc:5:4: error: expected primary-expression before 'int'
    5 | ???int num=1;
      |    ^~~
a.cc:5:4: error: expected ':' before 'int'
    5 | ???int num=1;
      |    ^~~
      |    :
a.cc:5:4: error: expected primary-expression before 'int'
    5 | ???int num=1;
      |    ^~~
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ???for(int i=0;i<n;i++)num*=10;
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ???for(int i=0;i<n;i++)num*=10;
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ???for(int i=0;i<n;i++)num*=10;
      |   ^
a.cc:6:4: error: expected primary-expression before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
a.cc:6:4: error: expected ':' before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
      |    :
a.cc:6:4: error: expected primary-expression before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
a.cc:6:4: error: expected ':' before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
      |    :
a.cc:6:4: error: expected primary-expression before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
a.cc:6:4: error: expected ':' before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
      |    :
a.cc:6:4: error: expected primary-expression before 'for'
    6 | ???for(int i=0;i<n;i++)num*=10;
      |    ^~~
a.cc:6:16: error: 'i' was not declared in this scope
    6 | ???for(int i=0;i<n;i++)num*=10;
      |                ^
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ???return num;
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ???return num;
      |  ^
a.cc:7:3: error: expected primary-expression before '?' token
    7 | ???return num;
      |   ^
a.cc:7:4: error: expected primary-expression before 'return'
    7 | ???return num;
      |    ^~~~~~
a.cc:7:4: error: expected ':' before 'return'
    7 | ???return num;
      |    ^~~~~~
      |    :
a.cc:7:4: error: expected primary-expression before 'return'
    7 | ???return num;
      |    ^~~~~~
a.cc:7:4: error: expected ':' before 'return'
    7 | ???return num;
      |    ^~~~~~
      |    :
a.cc:7:4: error: expected primary-expression before 'return'
    7 | ???return num;
      |    ^~~~~~
a.cc:7:4: error: expected ':' before 'return'
    7 | ???return num;
      |    ^~~~~~
      |    :
a.cc:7:4: error: expected primary-expression before 'return'
    7 | ???return num;
      |    ^~~~~~
a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
    8 | }
      | ^
a.cc: In function 'int serch(int, int)':
a.cc:11:1: error: expected primary-expression before '?' token
   11 | ???if(sum>21)return 0;
      | ^
a.cc:11:2: error: expected primary-expression before '?' token
   11 | ???if(sum>21)return 0;
      |  ^
a.cc:11:3: error: expected primary-expression before '?' token
   11 | ???if(sum>21)return 0;
      |   ^
a.cc:11:4: error: expected primary-expression before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
a.cc:11:4: error: expected ':' before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
      |    :
a.cc:11:4: error: expected primary-expression before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
a.cc:11:4: error: expected ':' before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
      |    :
a.cc:11:4: error: expected primary-expression before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
a.cc:11:4: error: expected ':' before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
      |    :
a.cc:11:4: error: expected primary-expression before 'if'
   11 | ???if(sum>21)return 0;
      |    ^~
a.cc:12:1: error: expected primary-expression before '?' token
   12 | ???else if(n==0)return sum;
      | ^
a.cc:12:2: error: expected primary-expression before '?' token
   12 | ???else if(n==0)return sum;
      |  ^
a.cc:12:3: error: expected primary-expression before '?' token
   12 | ???else if(n==0)return sum;
      |   ^
a.cc:12:4: error: expected primary-expression before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
a.cc:12:4: error: expected ':' before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
      |    :
a.cc:12:4: error: expected primary-expression before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
a.cc:12:4: error: expected ':' before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
      |    :
a.cc:12:4: error: expected primary-expression before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
a.cc:12:4: error: expected ':' before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
      |    :
a.cc:12:4: error: expected primary-expression before 'else'
   12 | ???else if(n==0)return sum;
      |    ^~~~
a.cc:13:1: error: expected primary-expression before '?' token
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      | ^
a.cc:13:2: error: expected primary-expression before '?' token
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |  ^
a.cc:13:3: error: expected primary-expression before '?' token
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |   ^
a.cc:13:4: error: expected primary-expression before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
a.cc:13:4: error: expected ':' before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
      |    :
a.cc:13:4: error: expected primary-expression before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
a.cc:13:4: error: expected ':' before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
      |    :
a.cc:13:4: error: expected primary-expression before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
a.cc:13:4: error: expected ':' before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
      |    :
a.cc:13:4: error: expected primary-expression before 'else'
   13 | ???else return max(serch(sum+11,n-1),serch(sum+1,n-1));
      |    ^~~~
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
a.cc: In function 'int main()':
a.cc:17:1: error: expected primary-expression before '?' token
   17 | ???string str;
      | ^
a.cc:17:2: error: expected primary-expression before '?' token
   17 | ???string str;
      |  ^
a.cc:17:3: error: expected primary-expression before '?' token
   17 | ???string str;
      |   ^
a.cc:17:11: error: expected primary-expression before 'str'
   17 | ???string str;
      |           ^~~
a.cc:17:10: error: expected ':' before 'str'
   17 | ???string str;
      |          ^~~~
      |          :
a.cc:17:11: error: 'str' was not declared in this scope; did you mean 'std'?
   17 | ???string str;
      |           ^~~
      |           std
a.cc:17:14: error: expected ':' before ';' token
   17 | ???string str;
      |              ^
      |              :
a.cc:17:14: error: expected primary-expression before ';' token
a.cc:17:14: error: expected ':' before ';' token
   17 | ???string str;
      |              ^
      |              :
a.cc:17:14: error: expected primary-expression before ';' token
a.cc:18:1: error: expected primary-expression before '?' token
   18 | ???while(getline(cin,str)){
      | ^
a.cc:18:2: error: expected primary-expression before '?' token
   18 | ???while(getline(cin,str)){
      |  ^
a.cc:18:3: error: expected primary-expression before '?' token
   18 | ???while(getline(cin,str)){
      |   ^
a.cc:18:4: error: expected primary-expression before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
a.cc:18:4: error: expected ':' before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
      |    :
a.cc:18:4: error: expected primary-expression before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
a.cc:18:4: error: expected ':' before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
      |    :
a.cc:18:4: error: expected primary-expression before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
a.cc:18:4: error: expected ':' before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~
      |    :
a.cc:18:4: error: expected primary-expression before 'while'
   18 | ???while(getline(cin,str)){
      |    ^~~~~