freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

編程的調(diào)試技巧-在線瀏覽

2024-09-17 11:18本頁面
  

【正文】 { LCD__puts(message)。 /* input string from key matrix*/ LCD__puts(buff)。\n39。 /* return */ } /*FUNC COMMENT************************************************************* * ID : * function name : get_strlength * function : refer string using pointer passed as argument, return length * parameter : str:address of string to count length * return : length * function used : none * notice : none * History : *FUNC COMMENT END********************************************************/ static int get_strlength(unsigned char *str) /* define function to get string length */ { int len = 0。\039。\039。 /* count number of character */ } return len。 /* display message */ LCD__putdec(dec)。\n39。 /* return */ } /***************************************************************************** end of file ******************************************************************************/ 一個編程風格良好的例子: 結(jié) 論 1 ? 永遠不要寫過長的語句,應該讓代碼盡可能簡單;永遠不要把兩條語句寫在一行中,以便于調(diào)試。 char op,a。 cinnum1num2endl。 cinopendl。*39。break。/39。break。+39。break。39。break。 } coutthe oute isouteendl。 coutdo you want to continue(y/n)\n。 }while(a==39。)。 cout請輸入 a或其他字符 endl。 if(c==39。) return 1。 } int main() { coutf()endl。 } 根據(jù)輸入給出輸出 結(jié) 論 2 ? 要盡可能的熟悉語法知識 ? 充分利用編譯器提供的信息 ? 編程過程中要細心 ? 思路要清晰,沒把握時,要先畫流程圖,然后再編碼 include int main() { double a, b, c, d。 cinabc。amp。 d = * a * a/4。 } if(c*c==a*a+b*b||a*a==b*b+c*c||b*b==a*a+c*c) { coutzhijiao sanjiaoxing\n。 coutdendl。 } 判斷三角形的形狀 結(jié) 論 3 ? 要掌握編程的本質(zhì): 是由程序員控制機器,使其按照我們的思路運轉(zhuǎn),機器本身沒有智能。 char op,a。y39。 cinop。 cininteger1。 cininteger2。 f=integer1integer2。 h=integer1/integer2。+39。 break。39。 break。*39。 break。/39。 break。 } } 兩個數(shù)的算術(shù)運算 include void main() { double integer1,integer2,e,f,g,h。 cina //分號、 while(a=?y?) //等號 { coutinput an op:。 coutinteger1 is:。 coutinteger2 is:。 switch(op). //點 { e=integer1+integer2。 g=integer1*integer2。 case 39。:coute。 case 39。:coutf。 case 39。:coutg。 case 39。:couth。 } cout“Do you want to continue(Y/N or y/n)?”。 ? 單步執(zhí)行是最重要的調(diào)試手段! include int main() { char type = s。!39。 cintype。amp。 if(type = 97 amp。 type = 122) cout輸入的字符為小寫字母 !endl。amp。 else { cout輸入的字符為其他字符 !endl。 } return 0。 while(type != 39。) { cout請輸入一個字符: endl。 if (type = 65 amp。 type = 90) cout輸入的字符為大寫字母 !endl。amp。 if(type = 48 amp。 type = 57) cout輸入的字符為數(shù)字 !endl。 } cout! to end !endl。 } 判斷一個字符是什么類別 通過單步執(zhí)行可以搞清程序的執(zhí)行線路,以發(fā)現(xiàn)錯誤點 include int main() { int m。 cinm。i=m1。 } cout階乘為 :mendl。 } 求階乘 include int main() { int m。 cinm。i=m1。 //循環(huán)體內(nèi)修改了循環(huán)條件 } cout階乘為 :mendl。 } 求階乘 通過單步執(zhí)行可以監(jiān)視變量的變化,當變量與預期不一致是,即找到了錯誤點 include int main() { int m。 cinm。 for(int i=1。i++) { m=m*i。 return 0。i=10。j=i。*39。 coutendl。 for(int t=1。t++) { for(int k=1。k++) cout39。 coutendl。 for(int s=1。s++) { for(int m=1。m++) cout39。 for(int n=10。n) cout39。 coutendl。 for(int z=1。z++) { for(int p=9。p) cout39。 for(int q=1。q++) cout39。 coutendl。 } 輸出星號 include void main() { for(int i=1。i++) { for(int j=1。j++) cout39。flush。 } coutendl。t=10。k=11t。*39。 } coutendl。s=10。ms1。 39。n=11s。*39。 } coutendl。z=10。p=10z。 39。q=z。*39。 } coutendl。i=10。j=i。*39。
點擊復制文檔內(nèi)容
醫(yī)療健康相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1