--- tags: DICE C --- 13-1 HaHaHa!笑他10次 === > [name=CHAWTeam] --- 目錄:[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC) --- 題目 --- ```! 寫一個程式,印出「HaHaHa!」10次。 輸入範例: 輸出範例: HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! C範例程式: #include <stdio.h> int main(){ int i=0; repeat: printf("HaHaHa!\n"); ......... if (......){ goto repeat; } return 0; } C++範例程式: #include <iostream> int main(){ int i=0; repeat: std::cout<<"HaHaHa!\n"; i=i+1; if (i<10){ goto repeat; } return 0; } ``` 程式碼 --- ```c= #include <stdio.h> int main() { int i = 0; repeat: printf("HaHaHa!\n"); i++; if (i < 10) { goto repeat; } return 0; } ``` 輸出 --- ```! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa! HaHaHa!HaHaHa! ``` --- [查看我們在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-13-1" 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