當前位置:編程學習大全網 - 遊戲軟體 - porand

porand

//#include "stdafx.h"//vc++6.0加上這壹行.

#include "stdio.h"

#include "time.h"

#include "stdlib.h"

void myfun(int (*p)[20],int *po,int *pe){

int i,j;

for(i=0;i<10;i++)

for(j=0;j<20;j++)

if(p[i][j]&1) (*po)+=p[i][j];

else (*pe)+=p[i][j];

}

void main(void){

int a[10][20],i,j,o_sum,e_sum;

srand((unsigned)time(NULL));

for(o_sum=e_sum=i=0;i<10;i++)

for(j=0;j<20;a[i][j++]=rand()/100);

myfun(a,&o_sum,&e_sum);

printf("The Odd_Sun is %d\nThe Even_Sun is %d\n",o_sum,e_sum);

}

  • 上一篇:有壹部戰爭片狙擊手要刺殺壹個人,但是時間太久他睡著了,錯過了刺殺。是什麽電影
  • 下一篇:"在支架上澆築混凝土梁"所謂的“支架”是不是腳手架?
  • copyright 2024編程學習大全網