Wordpress:显示子类别的帖子

I searched a lot for this but couldn't find a working solution for my exact problem.

What I am looking for is:

On category parent page:

Child category title I

Display X posts of subcategory

Child category title II

Display X posts of subcategory

Posts with no subcategory selected, but do have the parent

Display all other posts of parent category

etc..

And then for

On category child page:

Display all posts

I am looking for a solution I can write within the loop like this:

<?php the_title(); ?>

etc. (I hope everyone understands what I mean).

I am really thankful if some one helps me out, it's even better if it's with a little bit explanation of the result!

Firstly see the screenshot: See and create subcatagory

Then,

Follow the code here: Show wordpress subcategories only