Wrong Answer
/in/foo.cc: In function 'int main()':
/in/foo.cc:45:22: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
  while(~scanf("%d",&n)&&n)
                      ^
  /in/foo.cc: In function 'int main()':
/in/foo.cc:45:22: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
  while(~scanf("%d",&n)&&n)
                      ^