i have written the following file and execute this in the server - account

#include <stdio.h>
#include <stdlib.h>
system("ssh a_sriram@ \"cd public_html;for i in `ls -1|grep -v cv.html` ;do echo $i ;done\"");
system("ssh a_sriram@ \"cd public_html;ls -1|grep -v cv.html\"");


the second statement works .i.e it prints all the files in public_html
except cv.html .
whereas , the first statement doesnt work and gives the exception

bash: -c: line 2: syntax error near unexpected token `acm_2004'
bash: -c: line 2: `acm_2004'

acm_2004 is a directory in my 205 account.How is that the command ->ls
-1|grep -v cv.html
work in my 205 shell even after sshing to my 200 accnt?
how to make the 1st statement work like the 2nd one?

Thanks for your consideration,