1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#include <iostream>
#include <cstdlib>
using namespace std;
const int MAXDIM = 10;
const int PRIMTRI[10][10] = {
{2, 0},
{3, 5, 0},
{7, 11, 13, 0},
{17, 19, 23, 29, 0},
{31, 37, 41, 43, 47, 0},
{53, 59, 61, 67, 71, 73, 0},
{ 0 }
};
int main()
{
int i = 0, j = 0;
for(i = 0; i < MAXDIM; i++) {
if(PRIMTRI[i] == 0)
break;
for(j = 0; j < MAXDIM; j++) {
if(PRIMTRI[i][j] == 0)
break;
cout << PRIMTRI[i][j] << " ";
}
cout << endl;
}
system("pause");
return 0;
}
|