C语言实现舒尔特表格生成器

     舒尔特表这个方法是世界上最专业最普及最简单的训练法,广泛应用于飞行员航天员的训练,该表为训练注意力和视觉广度和视觉敏锐度的,它从这三方面训练注意力此法坚持一段时间就会感到很明显的进步。

通过代码实现一个 2*2到100*100之内的表,每个表随机产生20组,可以打印输出,也可以产生文件,方便拷贝到word中进行打印,话不多说,直接贴源码。

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>


int main()
{
    int j = 0,number = 0,n = 0,count=1,counter = 0;
    int a[10000]={0};
    char buff[64];
    FILE* fp;

    printf("输入舒尔特表格行数(≤100):");
    scanf("%d",&n);
    srand((unsigned) time(NULL));

    memset(buff, 0, sizeof(buff));
    counter  = 10;
    sprintf(buff,"Schulte_Grid_%dx%d.txt",n,n);
    fp = fopen(buff, "w+");

    for(j=0; j<counter; j++)
    {
      while(count<=n*n)
      {
        number= rand()%(n*n);
        if(a[number]==0)
        {
            a[number]=count;
            count++;
        }
      }

      for(count=0;count<n*n;count++)
      {
        if(count%n==0)
        {
            printf("\n");
            fprintf(fp,"\n");
        }

        printf("%4d ",a[count]);
        fprintf(fp,"%8d ",a[count]);
      }

      fflush(fp);

      count=1;
      memset(a, 0, sizeof(a));
      fprintf(fp,"\n");

   }

    fclose(fp);

}

 生成可执行的程序,输入参数N( 2<= N <= 100)

 打开生成的Schulte_Grid_6x6.txt 文件,将数据拷贝到word或者excel中即可打印


      31       24       27       26       28        5 
       9       35        7       33       16       19 
       1       21       29       10       32       15 
      25       36        6        3        4       30 
      12       18       11        8       13       17 
       2       20       23       34       22       14 

      24       31       26        4       28        2 
      25       32       33       10       15        9 
       1        6       27       34       23       29 
      20        5       12       21       13       36 
      11       35       19       22        3       16 
      17       30       18        8        7       14 

      29       17       23       24       31        5 
       8       26       27        3       18       10 
       1       34        2       21       12       32 
      20       28        9        7        6       13 
      15        4       16       33       36       35 
      19       14       30       25       11       22 

      22       15       21       24       23        4 
      14       35        2        6       30       33 
       9        3       16       34       31       29 
      11       27       26       25       32       19 
      36       17       13       10       20        1 
       5       18       28        8       12        7 

AutoFlowchart Version 2.4.3 ------------------------------------ what's is AutoFlowchart? -------------------------------------------------------------------- AutoFlowchart, the Professional sourcecode flowcharting tool. AutoFlowchart is a excellent tool to generate flowchart from sourcecode.Its flowchart can expand and shrink. and you can pre-define the the width , height,Horizontal spacing and vertical spacing. Move and zoom is also very easy. It can export the flowchart as a Microsoft Visio/Word file or a bitmap file. It can help programmers understand, document and visualize source code. It supports C,C++,VC++(Visual C++ .NET),Delphi(Object Pascal). In the future,It will support more languages. You can use it on Windows 9X/NT/me/XP. You can trial it for 50 times. Registration fee is $129. http://www.ezprog.com/order.htm what's new? -------------------------------------------------------------------- v2.4.3 [2008-07-12] 1. Add process to "return","continue" and "break"; 2. Revised the color when export to coloried Ms Word file; v2.4.1 [2008-04-21] 1. Add "read only" options; 2. Change multi language captions for "open project" and "save project"; v2.4 [2008-04-02] 1. Add "project" to AutoFlowchart to manage more files; v2.3 [2008-01-14] 1. auto show a detail code ; 2. use GDI+ to draw flowchart and draw text; 3. add search function; 4. change the arrowhead shape; 5. remove a bug when in Windows Server 2003; v2.0.3 [2007-12-06] 1. It's use a SDI window for flowchart instead of MDI, then it would be possible to display the code window on one monitor while displaying the flowchart on a second monitor! Thanks for Mr. Shahine Ghanbarzadeh! v2.0.2 [2007-11-29] 1. Add treatment to exceptional such as unmatched brackets. 2. Add treatment to special function which lines is more than 1000. Ms Visio is supported! Get Started -------------------------------------------------------------------- 1. Open a *.pas/*.c/*.cpp/*.afp file; 2. Double click the begin row of any statement ,then you can see a flowchart; 3. Click a apart of the FlowChart ,you can see the part of sentence of this block; 4. change the value of the first spinedit,you can see the current block. Register Notes: If you are a registered user, please put the license file to the install path. Check out our WWW Home Page: http://www.ezprog.com AutoFlowchart can be ordered for $79 from: CompuServe: ShareIt (#197238) Direct: http://www.shareit.com/product.html?productid=197238&languageid=1 Contact -------------------------------------------------------------------- support : support@ezprog.com sales : sals@ezprog.com Msn : support@ezprog.com _______ ____|__ | (R) --| | |------------------- | ____|__ | Association of | | |_| Shareware |__| o | Professionals -----| | |--------------------- |___|___| MEMBER
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值