Language: C++

[13:58, 16/03/2020] mousumi: #include<bits/stdc++.h> 
using namespace std;
int xyz(int i,int a[n],int b[n],int c[n],p)
 {
  int x;
  if(p==3)
  {
  x=max(a[i],b[i]);
  if(a[i]==b[i])
    {
    if(a[i+1]>b[i+1])
      p=2;
    else p=1;
    }
  else if (x==a[i])
    p=1;
  else if (x==b[i])
    p=2;
   }
  else if(p==2)
  {
  x=max(a[i],c[i]);
  if(a[i]==c[i])
    {
    if(a[i+1]>c[i+1])
      p=3;
    else p=1;
    }
  else if (x==a[i])
    p=1;
  else if (x==c[i])
    p=3;
   }
  if(p==1)
  {
  x=max(c[i],b[i]);
  if(c[i]==b[i])
    {
    if(c[i+1]>b[i+1])
      p=2;
    else p=3;
    }
  else if (x==c[i])
    p=3;
  else if (x==b[i])
    p=2;
   }
  return p;
  }
int main() 
{ 
  int n,i,j=0;
  cin>>n;
  int a[n],b[n],c[n],y[n],x[n];
  for(i=0;i<n;i++)
    {
    cin>>a[i];
    cin>>b[…
[12:18, 17/03/2020] mousumi: #include<bits/stdc++.h> 
using namespace std;
int xyz(int i,int a[],int b[],int c[],int p)
 {
  int x;
  if(p==3)
  {
  x=max(a[i],b[i]);
  if(a[i]==b[i])
    {
    if(a[i+1]>b[i+1])
      p=2;
    else p=1;
    }
  else if (x==a[i])
    p=1;
  else if (x==b[i])
    p=2;
   }
  else if(p==2)
  {
  x=max(a[i],c[i]);
  if(a[i]==c[i])
    {
    if(a[i+1]>c[i+1])
      p=3;
    else p=1;
    }
  else if (x==a[i])
    p=1;
  else if (x==c[i])
    p=3;
   }
  if(p==1)
  {
  x=max(c[i],b[i]);
  if(c[i]==b[i])
    {
    if(c[i+1]>b[i+1])
      p=2;
    else p=3;
    }
  else if (x==c[i])
    p=3;
  else if (x==b[i])
    p=2;
   }
  return p;
  }
int main() 
{ 
  int n,i,j=0;
  cin>>n;
  int a[n],b[n],c[n],y[n],x[n];
  for(i=0;i<n;i++)
    {
    cin>>a[i];
    cin>>b[i];
    cin>>c[i];
    }
 while(j!=n)
 {
   if(a[j]==b[j] && b[j]==c[j])
     {y[j]=a[j];
      y[j]=y[j]+y[j-1];
     j++;
      }
   else 
     break;
  }
  if(a[j]==b[j] && a[j]>c[j])
    {
    if (a[j+1]>b[j+1])
      p=2;
    else
      p=1;
    }
  if(a[j]==c[j] && a[j]>b[j])
    {
    if (a[j+1]>c[j+1])
      p=3;
    else
      p=1;
    }
  if(c[j]==b[j] && c[j]>a[j])
    {
    if (c[j+1]>b[j+1])
      p=2;
    else
      p=3;
    }
  else if (a[j]>b[j] && a[i]>c[i])
    p=1;
  else if (c[j]>b[j] && a[i]<c[i])
    p=3;
  else if (a[j]<b[j] && b[i]>c[i])
    p=2;
  if(p==1)
    y[j]=a[j]+y[j-1];
  else if(p==2)
    y[j]=b[j]+y[j-1];
  else if(p==3)
    y[j]=c[j]+y[j-1];
  for (i=j+1;i<n;i++)
  {
    p=xyz(i,a[n],b[n],c[n],p);
    if(p==3)
      y[i]=c[i];
    else if(p==2)
      y[i]=b[i];
    else if(p==1)
      y[i]=a[i];
    y[i]=y[i]+y[i-1];
    }
  cout<<y[n-1]<<endl;
  }

Compiler output:
a.cc:1:30: error: stray '#' in program
    1 | [13:58, 16/03/2020] mousumi: #include<bits/stdc++.h>
      |                              ^
a.cc:58:12: error: extended character … is not valid in an identifier
   58 |     cin>>b[…
      |            ^
a.cc:59:30: error: stray '#' in program
   59 | [12:18, 17/03/2020] mousumi: #include<bits/stdc++.h>
      |                              ^
a.cc:1:1: error: expected unqualified-id before '[' token
    1 | [13:58, 16/03/2020] mousumi: #include<bits/stdc++.h>
      | ^
a.cc:3:21: error: 'n' was not declared in this scope
    3 | int xyz(int i,int a[n],int b[n],int c[n],p)
      |                     ^
a.cc:3:23: error: expected ')' before ',' token
    3 | int xyz(int i,int a[n],int b[n],int c[n],p)
      |        ~              ^
      |                       )
a.cc:3:24: error: expected unqualified-id before 'int'
    3 | int xyz(int i,int a[n],int b[n],int c[n],p)
      |                        ^~~
a.cc: In function 'int main()':
a.cc:53:3: error: 'cin' was not declared in this scope
   53 |   cin>>n;
      |   ^~~
a.cc:58:12: error: '\U00002026' was not declared in this scope
   58 |     cin>>b[…
      |            ^
a.cc:59:4: error: expected ']' before ':' token
   59 | [12:18, 17/03/2020] mousumi: #include<bits/stdc++.h>
      |    ^
      |    ]
a.cc:59:4: error: expected ']' before ':' token
   59 | [12:18, 17/03/2020] mousumi: #include<bits/stdc++.h>
      |    ^
      |    ]
a.cc:62:2: error: a function-definition is not allowed here before '{' token
   62 |  {
      |  ^
a.cc:108:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  108 | int main()
      |         ^~
a.cc:108:9: note: remove parentheses to default-initialize a variable
  108 | int main()
      |         ^~
      |         --
a.cc:108:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:109:1: error: a function-definition is not allowed here before '{' token
  109 | {
      | ^
a.cc:174:4: error: expected '}' at end of input
  174 |   }
      |    ^
a.cc:56:5: note: to match this '{'
   56 |     {
      |     ^
a.cc:174:4: error: expected '}' at end of input
  174 |   }
      |    ^
a.cc:51:1: note: to match this '{'
   51 | {
      | ^