Presuming the course is A, you will find a sub group of it say subA with a publish postinsubA

When i personally use get_posts('category=A&...'), all posts under category A also postinsubA are came back, however i don't wanna postinsubA, how do i exclude these posts in sub groups?

Searching in the Wordpress manual, there's the query_posts() function that comes with a parameter that may meet your needs.

Here's a good example to drag only posts from category 129, but from no children groups of 129:

query_posts(array('category__in' => array(129)));
while(have_posts()) { the_post();
   echo '<li>'.the_title().'-'.the_category().'</li>';

You may also increase the groups into it, like array(128,129). Used to do a fast test on a single of my very own Wordpress blog in which the parent (129) had 2 posts, and also the child (139) had 1 publish. In making the loop, just the 2 posts in category 129 displayed.