--- tags: DICE C --- 16-6 遞減值 === > [name=CHAWTeam] --- 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) --- 題目 -- ```! 請撰寫一程式, 輸入一個等差遞減值n, 由100、100-n、...,印到>=1為止。 輸入範例: 25 輸出範例: 100 75 50 25 ``` 程式碼 -- ```c= #include <stdio.h> int main() { int n; scanf("%d", &n); for (int i = 100; i >= 1; ) { printf("%d ", i); i -= n; } return 0; } ``` 執行 -- ```! 25 100 75 50 25 ``` --- [查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam) 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) --- {%hackmd Iiu5mOixR7yWkPHKCkabBg %} <iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/chawteam/button?referrer=https://hackmd.io/@CHAWTeam/DiceC-16-6" width="100%"></iframe> --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}
×
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