Re: [問題] 這題目要的意思是??

看板C_and_CPP作者 (阿飄先生)時間15年前 (2010/10/18 12:58), 編輯推噓1(104)
留言5則, 4人參與, 最新討論串3/3 (看更多)
※ 引述《LPH66 (-858993460)》之銘言: : ※ 引述《kissmypenis (紅豬)》之銘言: : : 我是個初學C語言的高中生... : : 最近在寫一些簡單的程式 : : 老師出了一些題目當作業..其中一題為以下 : : 題目: Printing patterns 。 : : a. Write a function with the header : : Void line(int n , char c) : : Which will print n copies of the character c followed by a new line. : : b. Use this function in a program which reads in an integer and prints a : : triangle of the specified number of lines,in the following format: : : How main lines? 4 : : * : : ** : : *** : : **** : : c. Use this function in a program which reads in an integer and prints a : : triangle of the specified number of lines,in the following format: : : How main lines? 5 : : ********* : : ******* : : ***** : : *** : : * : : b跟c兩題我用for迴圈的方式可以寫得出來...我看不太懂a是要我寫甚麼??? : : 有利害的大大可以跟我解說嗎? 謝謝 ^^ : 這三題是個題組 : 後兩題其實是要你用第一題寫的函式來回答 : 而第一題是這樣的: 要你寫一個叫 line 的函式 : 長得像 void line(int n, char c) : 要能夠在呼叫它之後印出 n 個字元 c 附帶一個換行 void line(int n, char c) { while (n--) putchar(c); putchar('\n'); } 給一個簡單的答案 剩下的部份就用這個 line() 來完成 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.60.107.233

10/18 12:59, , 1F
我比較好奇的是題目 Void line(int n , char c) void為什麼
10/18 12:59, 1F

10/18 12:59, , 2F
是大寫 = =a
10/18 12:59, 2F

10/18 13:02, , 3F
說不定是C++/CLI XD
10/18 13:02, 3F

10/18 13:06, , 4F
其實只是word雞婆自己把首字轉大寫
10/18 13:06, 4F

10/18 13:07, , 5F
被 word 自動轉換的
10/18 13:07, 5F
文章代碼(AID): #1CkzG9oM (C_and_CPP)
文章代碼(AID): #1CkzG9oM (C_and_CPP)