【c++範例】前置定義

by - 清晨5:20


#include <iostream>
#define CPU "Central Processing Unit"  //定義字串
#define PI 3.14159  //定義常數
using namespace std;
int main(void)
{
    cout<<"CPU is short for "<<CPU<<endl;
    cout<<"π= "<<PI<<endl;
    return 0;
}

你可能會喜歡

0 意見