You really need to work on your presentation man:
1- The title is absolutely non-descriptive. Please edit your post to give it a proper title that says what you're trying to do or what your problem is exactly.
2- You really need to work on your indentation. My eyes hurt just by looking at your code. If you don't know how to properly indent, you can take a look at the
wikipedia page (for lack of a better example). This is very important ... VERY important.
3- Variable names like 'func' or 's' do not tell me what you're trying to do at all.
4- You should explain clearly what it is your program is trying to do, and write it in a
proper english. To quote Dijkstra:
Besides a mathematical inclination, an exceptionally good mastery of one's native tongue is the most vital asset of a competent programmer.
5- It is a good habit to always mention which compiler you're using.
Here's the deal: Solve these issues and I bet you, there's 99% chance you'll find your error by yourself. If not, update your post and we will help you.