# 程式設計(0516) ## 班級 學號 姓名 ### 結構 1. 宣告複數結構如下 ```plaintext typedef struct complex { int a; // 實部 int b; // 虛部 } COMPLEX; ``` 輸入兩複數變數c1,c2,求c1與c1的乘積。 例如:(1,2),(3,4)得到(-5,10) 呈現程式碼以及執行畫面 2. 宣告有理數結構如下 ```plaintext typedef struct rational { int p; // 分母 int q; // 分子 } RATIONAL; ``` 輸入有理數變數r的分母與分子,求最簡分數。 例如:(4,6)得到(2,3) 呈現程式碼以及執行畫面 --- 作業繳交方式:寄E-mail 收件人:lenghs@cc.ncue.edu.tw 主旨:程式設計(0516) 附件:程式設計(0516) - HackMD.pdf 內文:本日上課心得(字數不限不得省略)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up