# 114 程式設計實習I (資訊一乙) Week05 回家作業 ## 1. Ones ### 題目敘述 測資輸入一個數字 n (0 ≤ n ≤ 10000),n 無法被2或5整除。 若某個十進位數字是 n 的倍數,而且每個位數剛好都是1,請問這個數字最小是幾位數? Given any integer 0 ≤ n ≤ 10000 not divisible by 2 or 5, some multiple of n is a number which in decimal notation is a sequence of 1’s. How many digits are in the smallest such a multiple of n? --- ### 題目輸入 A file of integers at one integer per line. --- ### 題目輸出 Each output line gives the smallest integer x > 0 such that ![截圖 2025-10-05 18.59.41](https://hackmd.io/_uploads/Bkk31Aypll.png) where a is the corresponding input integer, and b is an integer greater than zero. --- ### 範例輸入1 ``` 3 7 9901 ``` ### 範例輸出1 ``` 3 6 12 ``` ## 2. Fourth Point !! (CPE) ### 題目敘述 Given are the (x, y) coordinates of the endpoints of two adjacent sides of a parallelogram. Find the (x, y) coordinates of the fourth point. --- ### 題目輸入 Each line of input contains eight floating point numbers: the (x, y) coordinates of one of the endpoints of the first side followed by the (x, y) coordinates of the other endpoint of the first side, followed by the (x, y) coordinates of one of the endpoints of the second side followed by the (x, y) coordinates of the other endpoint of the second side. All coordinates are in meters, to the nearest mm. All coordinates are between −10000 and +10000. Input is terminated by end of file. --- ### 題目輸出 For each line of input, print the (x, y) coordinates of the fourth point of the parallelogram in meters, to the nearest mm, separated by a single space. --- ### 範例輸入1 ``` 0.000 0.000 0.000 1.000 0.000 1.000 1.000 1.000 1.000 0.000 3.500 3.500 3.500 3.500 0.000 1.000 1.866 0.000 3.127 3.543 3.127 3.543 1.412 3.145 ``` ### 範例輸出1 ``` 1.000 0.000 -2.500 -2.500 0.151 -0.398 ``` ## 作業繳交方式 Assignment Submission Instructions * 交至ilearn作業繳交區 * 原始碼檔名以 學號_題號.c 命名 (example. D1109070_01.c, D1109070_02.c) * 僅一個檔案上傳(限定 C 語言) * [作業網址](https://oj.fcu.edu.tw/contest/1444) * 密碼:884848482492010