---
# System prepended metadata

title: 第五次實習課額外練習題 - Magician Transport!
tags: [實習額外加分題]

---

###### tags: `實習額外加分題`

第五次實習課額外練習題 - Magician Transport!
===

## hello!
這題比較難，所以做對的話會加 3 分，如果沒有做出正確解，但有達到基本要求，會加 1 分，我有提示相關參考內容給大家，請務必花時間看，我相信一定做得出來。

This question is more difficult, if you write the correct solution you will get 3 points, but if you only solve it in easy way, you will only get 1 point.
I provide related reference for you all, hope that you can use your own power to conquer this question!

## Description

Assume that your are a rookie magician, you have a special skill called ***Transport*** as known as ***TP***. This skill can let you transport to anywhere in the map (size 10x10).
Unfortunately, because you are newbie, you're technique is not proficient, so you just can transport **randomly**, you don't know where you will arrived if you use the skill.
Today you're teacher let you practice this skill, you can transport many times, according to yourself. After you finished the transportation, you have to tell teacher where are you now, he will take you back.

According to the above description, please design a program let you transport. Before start, you have to decide how many times you want to do. Eventually, please sum the distance in this journey and tell us the final position. Also please tell us the distance between last position and start point.

The start point is at $(0,0)$, and the boundary at the x-axis and y-axis are $(10,0)$ and $(0,10)$, so the top right coordinate is $(10,10)$.

tips1: how to produce a random integer?
https://www.cplusplus.com/reference/cstdlib/rand/
tips2: really randomly?
https://www.youtube.com/watch?v=naXUIEAIt4U
https://www.cplusplus.com/reference/ctime/time/
more tips? 
you can search anything you want by yourself.

## Constraint
* please use **for-loop** to solve this question.
* the best answer have to use ***time*** and ***srand***, if you only use **rand()**, the numbers will not be truly random, you can execute your program more times, you will find the mysterious thing.

---
> Cheer up baby! I know English is not easy, but you all guys have to conquer it!!!
> [name=Orange]
---
## Sample Input & Output 1

![](https://i.imgur.com/2rYFBhk.png)

