close

//---------------------------------------------------------------------------
#include <iostream>
#include <assert.h>

//---------------------------------------------------------------------------
int primes[] = {2, 3, 5, 7, 11, 13, 17};

int main(int argc, char* argv[])
{
        int index = 10;

        assert(index < (sizeof(primes)/sizeof(primes[0])));
        assert(index >= 0);
        std::cout << "The tenth prime is " << primes[index] << '\n';
        std::system("pause");
        return 0;
}
//---------------------------------------------------------------------------


 題目來源:C++風格與藝術 第二版 Steve Oualline 著 黃吉霈 編譯


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 jumbowind 的頭像
    jumbowind

    Quality of life is not what you get but what you become

    jumbowind 發表在 痞客邦 留言(0) 人氣()