Hi, I am Dr. Peter and would like to help.
1- Do they look like rice?
2- Have they had fleas?
Those worms are tapeworms you are seeing. The reason I ask is because tapeworms are transmitted by fleas sometimes. They need to be dewormed. One the best dewormer and also covers other types of parasites is called Fenbendazole (panacur, safeguard) you give 25mg per pound body weight a day for 3 days. Then repeat after 3 weeks. It is labeled for dogs but can be used for cats. You can order it online or pick up in your local pet store or vet's office.
If you have additional questions I will be glad to answer them.