Posts by Danilo Lucas • 91 points
2 posts
-
8
votes2
answers2364
viewsQ: Josephus problem (recursive)
This is the resolution, recursively made in C++, of josephus problem, where n is equal to the number of persons in the circle, and k is the number of step to be taken for the next person. #include…
-
1
votes2
answers1044
viewsA: String corresponding to real number
You can do so, you validate if it really is a number and if it is, if it is a real number. public static boolean isReal(String s){ boolean isNumber = false; boolean isReal = false; for(int x=0;…