-->
当前位置:首页 > 题库

PROGRAMMING:Jmu-java-02 basic grammar-01 comprehensive quiz

Luz5年前 (2021-05-10)题库438
After running the program, you can enter four options: ` FIB, sort, search, getbirthdate`
**FIB: * * print Fibonacci sequence according to input n. For example, input: 3, output: 1, 2
**Sort: * * input a series of numbers, then sort them and output them. Note that the format of array element output is * *] *, including** Tip: * * you can directly use the function arrays correlation method to process the output.
**Search: * * if found, return the location found; if not, return - 1** Tip: * * you can sort the array first, and then use the arrays related function to search.
**Getbirthdate: * * input n ID cards, extract the date of the input n ID numbers, and output them in the format of * * Year Month Day * *.
When the input is not FIB, sort, search, getbirthdate, the 'exit' will be displayed and the program will exit.
**Note: * * when processing input, try to use scanner's * * nextline() * * method to receive input. Do not mix nextline() with other next methods, otherwise, the end of line carriage return will not be processed and the next input will be affected.
**Reference: * * arrays, string in JDK document
###Input format:
```in
fib
three
sort
-1 10 3 2 5
search
-1
search
0
getBirthDate
one
three hundred and thirty thousand two hundred and twenty-six trillion and one hundred and ninety-six billion six hundred and five million fifty-four thousand one hundred and ninety
e
```
###Output format:
```out
1 1 2
[-1, 2, 3, 5, 10]
0
-1
1966-05-05
exit
```






answer:If there is no answer, please comment