题目描述
While loop is another loop like for loop but unlike for loop it only checks for one condition.
Here, we will use while loop and print a number n's table in reverse order.
Example 1:
Input: n = 1
Output: 10 9 8 7 6 5 4 3 2 1
Example 2:
Input: n = 2
Output: 20 18 16 14 12 10 8 6 4 2
Video:
Your Task:
You don't need to read anything. Your task is to complete the function printTable() which takes n as the input parameter and prints the table in reverse order with spaces and a newline character at the end.
Expected Time Complexity: O(n)
Expected Space Complexity: O(1)
Constraints:
1 ≤ n ≤ 1000
输入格式
见题面
输出格式
见题面
样例输入
n = 1
样例输出
10 9 8 7 6 5 4 3 2 1