阿摩線上測驗
登入
首頁
>
研究所、轉學考(插大)◆程式設計
>
110年 - 110 國立臺北科技大學_碩士班招生考試_自動化科技研究所:程式設計#107822
> 申論題
8. What is the output of the following code: (10%)
相關申論題
1. Implement a void function F that takes pointers to two arrays of integers (A and B) and a size N as parameters. It then populates B where B[i] is the sum of all ADil where j!- i.? For example: If A = {2, 1, 5,9}, then B would be {15, 16, 12, 8}. (10%)
#461970
2. What is the output of the following code: (10%)
#461971
3. What is the output of the following code: (10%)
#461972
4. Observe the following sequence xfn]={ 0. 1. 1, 2 3. 5, 8, 13, 21, 34, ...}where 0≤n≤ 30 and implment a program to compute x[30]. (10%)
#461973
5.What is the output of the following code: (10%)
#461974
6. Implement a program to print prime numbers between I to n where n is a any given integer. (10%)
#461975
7. Implement a program to swap two Integers without using temporary variable. (10%)
#461976
9. Given an array of integers A, implement a program to find and retumn the local maximum clement in it. For examplc, Input= [5, 17, 100, 11, 1, 50, 30], Output = [100, 50]. (10%)
#461978
10. Consider the following declaration of a 'two-dimensional array in C: Assuming that the main memory is byte-addressable and that the array is stored starting from memory address 0, what is the address of a[30][40]? (10%)
#461979
4. (25分) 數位邏輯可以用真值表或卡諾圖(Karnaugh)來表達。可以用電路來實現,也可以用程式寫入微控器來實現。大樓的抽水馬達,可以用數位邏輯來控制是否要啟動抽水。大樓有上下個一個水桶,下桶 T1 有一個低水位感測器 TL1 ,樓上水桶有一個低水位感測器 TL2 ,以及滿水位感測器 TF2 ,另外還有個電源開關 P 。若感測器條件成立為 1 ,不成立為 0 ,電源開關開為 1 ,關為 0 ,以下卡諾圖可表示馬達何時啟動抽水 M=1 。上桶不可能同時低又滿,因此 TF2 列與 TL2 行交义處都是不可能存在的打 X 。當無電源時 P ,馬達一律不抽因此涵蓋的列均為不抽填 0 。當下水桶低時 TL1 ,馬達一律不能抽水,因此同行均為 0 。上桶滿時 TF2 不抽水同列均為 0 。只有開電源 P 下水桶有水 TL1 ,且上水桶未滿 TF2 ,馬達才抽水填 1 。請撰寫一個抽水馬達致動函式,以 P , TL1 , TL2 , TF2 為輸入,以抽水馬達最否抽水為輸出。
#527232
相關試卷
110年 - 110 國立中央大學_碩士班招生考試_機械工程學系(光機電工程)/機電系統控制組(一般生):程式設計#124001
110年 · #124001
110年 - 110 國立臺北科技大學_碩士班招生考試_自動化科技研究所:程式設計#107822
110年 · #107822