Ejemplo n.º 1
0
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    if(n%2==1)odd(0,0,0,n);
    else if(n%4==2)oddeven(n);
    else even(n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
            printf(" %d",a[i][j]);
        printf("\n");
    }
    system("pause");
    return 0;
}
Ejemplo n.º 2
0
int oddeven_c ()
{
  int i_img, sup=12;

  //Tk_PhotoHandle img_handle;
  //Tk_PhotoImageBlock img_block;

  if( verbose ) printf( "Odd/even");
  //Tcl_SetVar(interp, "tbuf", val, TCL_GLOBAL_ONLY);
  //Tcl_Eval(interp, ".text delete 2");
  //Tcl_Eval(interp, ".text insert 2 $tbuf");

  for (i_img=0; i_img<n_img; i_img++)
    {
      oddeven (img_name[i_img], img[i_img], img[i_img], sup, 0, chfield, i_img);

      if (display) {
#if 0
      img_handle = Tk_FindPhoto( interp, "temp");
      Tk_PhotoGetImage (img_handle, &img_block);
      tclimg2cimg (interp, img[i_img], &img_block);

      sprintf(val, "newimage %d", i_img+1);
      Tcl_GlobalEval(interp, val);
#endif
      }
    }

  if(verbose) printf( "...done\n");
  //Tcl_SetVar(interp, "tbuf", val, TCL_GLOBAL_ONLY);
  //Tcl_Eval(interp, ".text delete 3");
  //Tcl_Eval(interp, ".text insert 3 $tbuf");

  return TCL_OK;

}