1. 程式人生 > >註釋的位置應與被描述的代碼相鄰

註釋的位置應與被描述的代碼相鄰

using ios out pre The clu get pau loop

註釋的位置應與被描述的代碼相鄰,可以放在代碼的上方或右方 ,不 可放在下方。

 1 #include <iostream>
 2 #define   PI   3.1416
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6         int i=100;
 7 #if 1
 8     cout<<"
i="<<i<<endl; 9 #endif 10 11 #ifdef PI 12 cout<<"1 PI="<<PI<<endl; 13 #endif 14 15 #ifndef PI 16 cout<<"2 PI="<<PI<<endl; //此語句不被編譯執行 17 #endif 18 return 0; 19 }

註釋的位置應與被描述的代碼相鄰