基本練習一.docVIP

  • 4
  • 0
  • 约1.18千字
  • 约 12页
  • 2018-03-24 发布于天津
  • 举报
基本練習一

程式設計範例及練習 Class 1.4 基本練習一 Index Example 1.4-1 九九乘法表 Example 1.4-2 求二維方程式的解 Example 1.4-3 輸出三角陣列 Example 1.4-4 計算學生成績 Example 1.4-5 計算所得稅基本稅額 Example 1.4-6 猜數字 Example 1.4-7 輸入任意兩個數字求出最大公因數 Example 1.4-8 產生亂數 Example 1.4-9 輸入字串,將大 小 寫字母轉成小 大 寫 Example 1.4-10 計算N! Example 1.4-11 輸入兩數字A, B,求得A的B次方 Example 1.4-1: 使用巢狀迴圏,輸出九九乘法表 Go to index Example 1.4-2: 一個二維方程式: , 輸入a值, 並求其二個根值root1及root2, 如果根值為虛數, 則輸出錯誤資訊, 並脫離程式 Go to index Example 1.4-3: 用for迴圈, 寫出下列數字排列 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 4 5 6 7 8 9 5 6 7 8 9 6 7 8 9 7 8 9 8 9 9 Go to index Example 1.4-4: 學生人數十人, 請用標準輸入, 輸入學生得分, 計算其平均分數, 及與平均分數的分數差, 並用標準輸出, 輸出結果 Go to index Example 1.4-5: 請用程式寫出, 當吾人輸入年收入資料時, 及輸出適用所得稅基本稅額, 吾人年收入的扣繳稅額與所得稅率有關, 如下表所示: Go to index Example 1.4-6: 由電腦程式隨機產生四個不相同的數字,由玩家來猜這四個數字,玩家輸入所猜的數字後,若未完全猜中這四個數字,則須告知玩家共猜對幾個數字以及猜對位置的個數,接著再由玩家繼續猜直到完全猜對為止。 Go to index Example 1.4-7:輸入任意兩個數字求出最大公因數。 Go to index Example 1.4-8:輸入一個數字得到六組範圍為1~42的亂數。 Go to index Example 1.4-9:輸入一組字串,如果遇到字母,則大寫變小寫,小寫變大寫。遇到數字則不變。 Input: telEVISION32 Output: TELevision32 Go to index Example 1.4-10:輸入一個整數N,計算N!。 Go to index Example 1.4-11:輸入兩數字A, B,求得A的B次方。 Go to index 4

文档评论(0)

1亿VIP精品文档

相关文档