Language: C

#include<stdio.h>

int main()
{
  int n;
  scanf("%d", &n);
  
  long long int num[n], cursum[n], total = 0;
  scanf("%lld", num);
  *cursum = *num;
  for (int p = num + 1, q = cursum + 1, pd = num + n; p < pd; p++, q++)
  {
  	scanf("%lld", p);
    *q = *(q - 1) + *p;
    if ((*q) > (2 << 60)) *q %= 1000000007;
  }
  
  for (int p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
  {
    sum += *p * *q;
    if (sum > (2 << 60)) sum %= 1000000007;
  }
  
  printf("%lld", sum);
  
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:11:16: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   11 |   for (int p = num + 1, q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                ^~~
main.c:11:29: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   11 |   for (int p = num + 1, q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                             ^~~~~~
main.c:11:46: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   11 |   for (int p = num + 1, q = cursum + 1, pd = num + n; p < pd; p++, q++)
      |                                              ^~~
main.c:14:5: error: invalid type argument of unary '*' (have 'int')
   14 |     *q = *(q - 1) + *p;
      |     ^~
main.c:14:10: error: invalid type argument of unary '*' (have 'int')
   14 |     *q = *(q - 1) + *p;
      |          ^~~~~~~~
main.c:14:21: error: invalid type argument of unary '*' (have 'int')
   14 |     *q = *(q - 1) + *p;
      |                     ^~
main.c:15:10: error: invalid type argument of unary '*' (have 'int')
   15 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |          ^~
main.c:15:19: warning: left shift count >= width of type [-Wshift-count-overflow]
   15 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |                   ^~
main.c:15:27: error: invalid type argument of unary '*' (have 'int')
   15 |     if ((*q) > (2 << 60)) *q %= 1000000007;
      |                           ^~
main.c:18:16: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   18 |   for (int p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                ^~~
main.c:18:29: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   18 |   for (int p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                             ^~~~~~
main.c:18:42: error: initialization of 'int' from 'long long int *' makes integer from pointer without a cast [-Wint-conversion]
   18 |   for (int p = num + 1, q = cursum, pd = num + n; p < pd; p++, q++)
      |                                          ^~~
main.c:20:5: error: 'sum' undeclared (first use in this function); did you mean 'num'?
   20 |     sum += *p * *q;
      |     ^~~
      |     num
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:12: error: invalid type argument of unary '*' (have 'int')
   20 |     sum += *p * *q;
      |            ^~
main.c:20:17: error: invalid type argument of unary '*' (have 'int')
   20 |     sum += *p * *q;
      |                 ^~
main.c:21:18: warning: left shift count >= width of type [-Wshift-count-overflow]
   21 |     if (sum > (2 << 60)) sum %= 1000000007;
      |                  ^~