练习数组指针作为函数参数:求3×4的二维数组{1,3,5,7,9,11,13,17,19,21,23,25}中的所有元素之

练习数组指针作为函数参数:求3×4的二维数组{1,3,5,7,9,11,13,17,19,21,23,25}中的所有元素之和。帮忙写出程序,非常感谢~
#include<iostream>

using namespace std;

int sum( const int array[][4], int row, int col )
{
int s = 0;
for( int i=0; i<row; ++i )
for( int j=0; j<col; ++j )
{
s+=array[i][j];
}

return s;
}

int main()
{
int array[][4]={1,3,5,7,9,11,13,17,19,21,23,25};

cout<<sum(array,3,4)<<endl;
return 0;
}
#include<iostream> //若为6.0编译器,改为#include<iostream.h>
using namespace std; //大闹6.0,将此句删除!
void main()
{
int sum(int *p);
int s[]={1,3,5,7,9,11,13,15,17,19,21,23,25},*p,d;
p=s;
d=sum(p);
cout<<d<<endl;
}
int sum(int *p)
{
int *t,s=0;
t=p;
for(;p<t+13;p++) //13为指仿盯数组元素个唯和数
s+=*p;
return s;
}
#include <stdio.h>
#include <烂宏stdlib.h>

int main()
{
int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23};
int *p;
for (p=a[0];p<档没a[0]+12;p++)
{
if ((p-a[0])%4==0)printf("\n");
printf("饥蠢册%4d",*p);
}
return 0;
}