MOONOJ1051 scared I picked up hold hold hold my small carp of my my my explanations cycle basis title

Description [title]
Enter a number n, the output "scared I picked up the holding (n times) My little carp I (n times)."
For example, n = 3, then the output "scared I picked up hold hold hold my little carp My My My"
[Input Format]
Only one input integer n (1 <= n <= 30).
[Output format]
Output "scared I picked up the holding (n times) My little carp I (n times)." The results per line.
[Sample input]
3
[Sample output]
Scared I picked up my little hold hold hold carp of my my my
Sample [explain]
For the sample, because n == 3, therefore I am "scared I picked up the" back output three times "holding", after "my little carp" output three times, "I am."
[Data] scale
50% of the data, satisfying 1≤n≤10;
100% data satisfy 1≤n≤30.
[Analysis] title
This question we can use the loop to do, we need to output "scared I picked up," and then we open a for loop, loop n times the output "hold", and then we re-export "My little carp" then we look for open loop, loop n times the output of "my." that's it. Is not it simple?
Code is implemented as follows:
#include <bits / STDC ++ H.> 
the using namespace STD; 
int n-; 
int main () { 
    CIN n->>; 
    COUT << "scared I picked up"; 
    for (int I = 0; I <n-; I ++) cout << "hold"; 
    COUT << "my little carp"; 
    for (int I = 0; I <n-; I ++) cout << "I"; 
    COUT << endl; 
    return 0; 
}

  

Guess you like

Origin www.cnblogs.com/mooncode/p/MOONOJ1051.html