Assuming we're dealing with a router (4-port device in the picture with the antennae and a WAN port) and a switch (big device with 24 ports in your images though not all switches have 24 ports), you can easily do that. The PCs will connect to any open ports on the switch and you connect any open port on the switch to the router. Just how it looks in your pictures. The 10ft run is well within any Category 5 or 6 cable's max specified length.
If you're dealing with router to router you have to turn routing off on the router you'd connect the PCs to so it would act like a simple switch.