Home > Back-end >  Cattle from error
Cattle from error

Time:01-24

# include & lt; Iostream>
using namespace std;

Int A, [100010].

Int main ()
{
A [0]=0;
Int n=0, m=0;
cin> N & gt;> m;
Int g=0;
For (int I=1; I & lt;=n; + + I)
{
cin> g;
A [I]=g;
A [I] +=A, [I - 1].
}
For (int j=0; J & lt; m; + + j)
{
Int bg=0, end=0;
cin> Bg & gt;> end;
Int sum=A [end] - A, [bg - 1].
cout }
return 0;
}
The above is a period of error...
Results back and tried it on, plus a constant passed???
# include & lt; Iostream>
using namespace std;

Const int MAX 1 e7 + 10=;
Int A, (MAX).

Int main ()
{
A [0]=0;
Int n=0, m=0;
cin> N & gt;> m;
Int g=0;
For (int I=1; I & lt;=n; + + I)
{
cin> g;
A [I]=g;
A [I] +=A, [I - 1].
}
For (int j=0; J & lt; m; + + j)
{
Int bg=0, end=0;
cin> Bg & gt;> end;
cout }
return 0;
}
This is why
  • Related