Language: C++

include<iostream> using namespace std; #define h 100100 int t[h]; 	int main(){ 	int n; 	cin>>n; 	int i=1; 	while(n --){ 		cin>>t[i]; 		i++; 	} 	int m; 	cin>>m; 	while(m--){ 		int p,x; 		cin>>p>>x; 		int c; 		c=t[p]; 		t[p]=x; 		int sum=0; 		for(int j=1;j<i;j++){ 			sum+=t[j]; 		} 		cout<<sum<<endl; 		t[p]=c; 	} 	return 0; }

Compiler output:
a.cc:1:40: error: stray '#' in program
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                        ^
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      | ^~~~~~~
a.cc:1:41: error: 'define' does not name a type
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                         ^~~~~~
a.cc: In function 'int main()':
a.cc:1:97: error: 'cin' was not declared in this scope
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                                                                                 ^~~
a.cc:1:158: error: 't' was not declared in this scope
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                                                                                                                                              ^
a.cc:1:307: error: 't' was not declared in this scope
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                                                                                                                                                                                                                                                                                                   ^
a.cc:1:457: error: 'cout' was not declared in this scope
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^~~~
a.cc:1:468: error: 'endl' was not declared in this scope
    1 | include<iostream> using namespace std; #define h 100100 int t[h];       int main(){     int n;  cin>>n;         int i=1;        while(n --){            cin>>t[i];              i++;    }       int m;  cin>>m;         while(m--){             int p,x;                cin>>p>>x;              int c;          c=t[p];                 t[p]=x;                 int sum=0;              for(int j=1;j<i;j++){                   sum+=t[j];              }               cout<<sum<<endl;                t[p]=c;         }       return 0; }
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^~~~