【文章內(nèi)容簡介】
”的 C程序 include int main() { printf(“Hello World! \n”)。 return 0。 } 主函數(shù)的函數(shù)頭,全局惟一 預(yù)編譯指令,包含標準頭文件 函數(shù)體,花括號內(nèi)為語句序列 標準庫函數(shù),在輸出設(shè)備(一般為屏幕)上輸出一行文本。 雙引號內(nèi)為字符串內(nèi)容, ’ \n’為轉(zhuǎn)義字符,表示換行, 分號表示語句結(jié)束。 函數(shù)結(jié)束執(zhí)行,程序退出 ? 編寫程序,計算三個實數(shù)的平均值 // Get the average value of three floats include int main() { float a, b, c, aver。 printf(“Please input three floats:\n”)。 scanf(“%f,%f,%f”, amp。a, amp。b, amp。c)。 /* Computing */ aver = (a + b + c) / 3。 printf(“\naverage = %f\n”, aver)。 return 0。 } 包含標準 I/