Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A Cat will do the count and at the last count will make a jump saying "jump!" according to the number we input, it is done as much as the number of numbers we input.
If the input is more than 7 then the Cat will say "What?" because the ability of the cat is only up to 7x jump.

*Leave a space for each count and jump.

Example :

Input Output
3 1 2 jump! 1 2 jump! 1 2 jump!
4 1 2 3 jump! 1 2 3 jump! 1 2 3 jump! 1 2 3 jump!
10 What?

What I have tried:

ive tried using simple code which is doesnt organized.
Posted
Updated 6-Oct-22 17:24pm
Comments
Dave Kreskowiak 6-Oct-22 21:45pm    
Well, if you don't show your code, you're not going to get any help with it.
Member 8428760 10-Oct-22 19:10pm    
In your loop, instead of > put >=

1 solution

First accept input of two items : the count and a string. Then write a loop that outputs the string in every iteration.

This function can accept input : cplusplus.com : sscanf/[^] and
This function can output the string : cplusplus.com : printf[^].

You need to write the code yourself. Both of those reference pages have sample code that can help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900