foo.cpp:22:2: error: expected initializer before 'scanf'
scanf("%d%d",&n,&m);
^
foo.cpp:24:2: error: expected unqualified-id before 'for'
for (i=1;i<=m;i++)
^
foo.cpp:24:11: error: 'i' does not name a type
for (i=1;i<=m;i++)
^
foo.cpp:24:16: error: 'i' does not name a type
for (i=1;i<=m;i++)
^
foo.cpp:39:3: error: 't' does not name a type
t=0;h=0;
^
foo.cpp:39:7: error: 'h' does not name a type
t=0;h=0;
^
foo.cpp:40:9: error: expected constructor, destructor, or type conversion before '(' token
memset(x,0,sizeof(x));
^
foo.cpp:41:3: error: expected unqualified-id before 'for'
for (i=1;i<=n;i++)
^
foo.cpp:41:12: error: 'i' does not name a type
for (i=1;i<=n;i++)
^
foo.cpp:41:17: error: 'i' does not name a type
for (i=1;i<=n;i++)
^
foo.cpp:43:3: error: expected unqualified-id before 'while'
while (h<t)
^