亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? c6.c

?? Cryptanalysis Source Code in C
?? C
字號:
/* The following code is provided as is. *        It may be copied and modified freely provided that *Joseph M. Reagle Jr. is acknowledged within the code as the *originator.*/#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>#define HISTORY_SIZE    200#define VOWELS_PER_LINE 200#define STOP            -1 int 	heigth = 15, width = 20;			int 	history[HISTORY_SIZE];		/* history array of past swaps*/int 	place=0;                        /* place in history array */char    *original_matrix;               /* oringal matrix read from file */int is_vowel(char token)/* is token a vowel? */{   switch (token) {   case 'a':      return 1;   case 'e':      return 1;   case 'i':      return 1;   case 'o':      return 1;   case 'u':      return 1;   default:      return 0;   }}void get_size(char *argv[], int *size) /* reads in size of file */{   FILE    *lfp;   int     lch;      if ((lfp=fopen (argv[1], "r"))==NULL) {      printf("Cannot open file\n");      exit(1);   }   while ((lch=fgetc(lfp)) != EOF ) {      if (lch != '\n') {	 *size += 1;      }   }   fclose (lfp);   printf ("Size = %d\n", *size);   return;}void get_matrix(char *argv[], char *matrix, int size)/*reads in the file, same as get_size in structure*/{      FILE    *ifp;   int     ch;   int     counter = 0;      if ((ifp=fopen (argv[1], "r"))==NULL) { /* can it be opened */      printf("Cannot open file\n");      exit(1);   }   while ((ch=fgetc(ifp)) != EOF ) {      printf("%c", ch);      if (ch != '\n') {	 matrix[counter] = ch;             /* read into counter */	 counter++;      }   }   fclose(ifp);   printf ("Read in %d chars\n", counter);   return;}char get_element (char* matrix, int x, int y)/* allows access of singular as a double array */{   return matrix[(y-1)*(width) + x-1];}void put_element (char* matrix, int x, int y, int element)/* allows modifying a singular array as a double */{   matrix[(y-1)*(width) + x-1] = element;}void save_matrix (char *matrix, int size, FILE *fp)/* saves the array as a rectangle of (width, height) size */{    int 		counter=0;      fprintf(fp, "   %d x %d\n", width, heigth);   fprintf(fp, "\n------------------------------\n");   while (counter < size) {		      fprintf(fp, "%c", matrix[counter]);      if ( (counter+1)%width==0 ) fprintf(fp, "\n");      counter++;   }   fprintf(fp, "\n------------------------------\n");}void print_matrix (char *matrix, int size)/* prints the array as a rectangle of (width, height) size */{    int 	counter=1;   int	vowels=0;   int  array_of_vowels[VOWELS_PER_LINE]; /* history of vowel counts */   int  AOV_counter=0;                    /* counter for above */   int   stat_variance=0;                 /* statistical variance */   int   stat_average =0;   /* HEADER */   printf("   %d x %d\n", width, heigth);   printf("------------------------------\n");   while(counter<=width)      printf(" %d", counter++%10);	/* head of columns    */   printf("\n");   /* PRINT AND UPDATE STAT INFO */   counter=0;   while (counter < size) {		      printf(" %c", matrix[counter]);   /* print the value   */      if (is_vowel(matrix[counter])){   			 vowels++;			/* a vowel was found */	       }      if ( (counter+1)%width==0 ) {	 printf("  %d\n", vowels);	/* go to next row    */	 array_of_vowels[AOV_counter] = vowels;	 AOV_counter++;	 vowels = 0;      }      counter++;   }   if (size%width != 0) {         /* last line of vowel output */      printf("  %d\n", vowels);   /* if it was a perfect fit, don't bother*/      array_of_vowels[AOV_counter] = vowels;      AOV_counter++;      vowels = 0;   }   array_of_vowels[AOV_counter] = STOP;   /* signifies end */   /* FOOTER */   counter=1;                              while(counter<=width)      printf(" %d", counter++%10);	/* foot of columns    */	          printf("\n------------------------------\n");      /* COMPUTE STATISTICS */   AOV_counter = 0;   while (array_of_vowels[AOV_counter] != STOP) {  /* compute stat_aver */      stat_average += array_of_vowels[AOV_counter]; /* sum the elements  */      AOV_counter++;   }   stat_average = stat_average/AOV_counter;        /* average the elemts */   AOV_counter = 0;   while (array_of_vowels[AOV_counter] != STOP) {  /* compute variance  */      stat_variance += pow( (array_of_vowels[AOV_counter] - stat_average), 2);      AOV_counter++;   }	       printf("The Statistical Average is %d\n", stat_average);   printf("The Statistical Variance is %d\n", stat_variance);}void swap(char *matrix, int first, int second)/* does a permutation of columns */{   int						temp;   int						row=1;      history[place] = first;		/* update this history file     */   place=(place+1)%HISTORY_SIZE;	/* with the two columns swapped */   history[place]= second;   place=(place+1)%HISTORY_SIZE;	   printf("history for %d and %d recorded\n", 	  history[place-2], history[place-1]);   while (row <= heigth) {          temp = get_element(matrix, first, row);      put_element(matrix, first, row, get_element(matrix, second, row));      put_element(matrix, second, row, temp);		      row++;		       /* swaps elements of comns. 1 row at a time */   }}void undo(char *matrix)/* swap the last 2 columns in the history array */{   if (place < 2)        printf("Error:Undo--Empty history file (At original)\n");   else {      printf("Swapping %d and %d back\n", 	     history[place-1], history[place-2]);	      swap (matrix, history[place-1], history[place-2]);      place -= 4;      /* since undo, causes the undo swap to be entered */   }		       /* into the history, I must go back 4 spaces in it*/}void resize(int x, int y)/* resize the rectangle */{   width  = x;   heigth = y;}void advise(int size)/* advise for column size */{   int root;			     /* sqrt of size */   int row;			     /* for any given row */   int column;			     /* for any given column */   int high, low; 		     /* low and high bound for coumn */      root = ceil(sqrt(size));          /* defines high range*/   row = root;   printf("The root of size %d is =~ %d\n", size, root);   while (row >= ceil(root/2)) {     /* defines low range */      printf("row = %d,  c =", row);      high = floor(size/(row-1));      low  = ceil((float)size/row);       for (column=low;column<=high;column++) {	 printf(" %d", column);      /* it works according to kinkov */	 if(column*row==size) printf("*"); /* yields an even rectangle */      }      row--;      printf("\n");   }}void interface(char* argv[], char *matrix, int size, FILE *fp)/* a clumsy interface to my routines */{   char str[10];   int  option1, option2;      while (str[0]!='e') {      printf("command: ");      gets(str);      printf("command registered\n");      switch (str[0]) {      case 'a':                 /* advise */	 advise(size);	 break;      case 'h':                 /* help */	 printf("Advise, Exit, New, Print, Resize, SAve, SWap, Undo\n");	 break;      case 'e':                 /* exit */	 printf("Exiting\n");	 break;      case 'r':   		/* resize */		 sscanf(str, "%*s %d %d", &option1, &option2);	 width = option1;	 heigth = option2;	 print_matrix(matrix, size);		 break;      case 's': 				 if (str[1]=='w') {	/* swap */ 			    sscanf(str, "%*s %d %d\n", &option1, &option2);	    printf ("o1 = %d, o2 = %d\n", option1, option2);	    swap(matrix, option1, option2);	    print_matrix(matrix, size);		 }	 else if (str[1]=='a') {/* save */	    save_matrix(matrix, size, fp);	    printf("Saved message\n");	 }	 else printf("Error in command: swap or save?\n");	 break;      case 'u': 		/* undo */	 undo(matrix);	 print_matrix(matrix, size);		 break;      case 'n':			/* new */	 place=0;		/* reset history */	 strcpy(matrix, original_matrix);       /* restores matrix */	 print_matrix(matrix, size);		 break;      case 'p':			/* print */	 print_matrix(matrix, size);		 break;      default:	 printf("Error, didn't understand command\n");		      }		   }}main (int argc, char* argv[]){      int     size = 0;   char    *matrix;   FILE	*fp;      if(!(fp=fopen("crypt.log", "w"))) {   /* log file */      printf("cannot open file\n");      exit(EXIT_FAILURE);   }	    get_size(argv, &size);   if (!(matrix = malloc(size))) printf("Error\n");   if (!(original_matrix = malloc(size))) printf("Error\n");   get_matrix(argv, original_matrix, size);   strcpy(matrix, original_matrix);   print_matrix(matrix, size);   print_matrix(original_matrix, size);   advise(size);   interface(argv, matrix, size, fp);	   fclose(fp);                           /* close log file */   return EXIT_SUCCESS;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费高清成人在线| www.av亚洲| 国产suv精品一区二区三区| 92国产精品观看| 欧美一区二区人人喊爽| 亚洲欧洲成人av每日更新| 天堂久久久久va久久久久| 成人福利视频网站| 欧美成人a在线| 亚洲第一福利一区| 91原创在线视频| 久久久久国产一区二区三区四区| 亚洲综合av网| 成人av电影免费观看| 久久日一线二线三线suv| 亚洲国产成人91porn| www.亚洲人| 亚洲国产精品传媒在线观看| 免费观看91视频大全| 欧美性感一区二区三区| 国产精品久久三| 国产成人精品免费| 久久亚洲一区二区三区明星换脸| 亚洲18女电影在线观看| 色婷婷狠狠综合| 亚洲同性同志一二三专区| 成人一道本在线| 国产欧美综合在线| 国产成人一级电影| 久久精品无码一区二区三区| 国产一区在线观看视频| 日韩免费高清av| 蜜臀久久99精品久久久久宅男| 欧美影片第一页| 亚洲成人免费视| 欧美卡1卡2卡| 捆绑调教美女网站视频一区| 91精品蜜臀在线一区尤物| 丝袜脚交一区二区| 欧美精品欧美精品系列| 日韩av一区二| 精品美女在线观看| 国产精品1024| 国产三级精品三级在线专区| 国产成人精品免费看| 国产精品色在线观看| 99re视频精品| 亚洲综合清纯丝袜自拍| 欧美美女视频在线观看| 久久精品国产久精国产| 久久免费视频一区| 成人av资源在线观看| 一区二区三区四区亚洲| 7777精品伊人久久久大香线蕉经典版下载| 亚洲午夜在线电影| 欧美一二三在线| 国产精品123区| 一区二区三区在线不卡| 日韩三级免费观看| 国产91在线看| 夜夜嗨av一区二区三区中文字幕| 3atv一区二区三区| 国产乱码精品一品二品| 亚洲欧美日韩一区| 日韩精品专区在线| jvid福利写真一区二区三区| 亚洲va在线va天堂| 久久精品综合网| 在线观看视频一区二区| 久久99国产精品成人| 亚洲欧洲日韩在线| 制服.丝袜.亚洲.另类.中文 | 久久机这里只有精品| 国产丝袜在线精品| 欧美午夜宅男影院| 国产一区二区视频在线| 亚洲欧美一区二区三区极速播放 | 亚洲毛片av在线| 日韩欧美一区在线| 91丨porny丨首页| 麻豆成人综合网| 亚洲男人天堂av网| 国产亚洲人成网站| 日韩视频中午一区| 色94色欧美sute亚洲13| 国产一区二区三区四区在线观看| 亚洲精品国产视频| 国产欧美视频在线观看| 在线播放亚洲一区| 欧美专区在线观看一区| 成人综合婷婷国产精品久久蜜臀 | 亚洲一区av在线| 国产清纯白嫩初高生在线观看91| 国产午夜精品福利| 欧美一区二区国产| 在线观看日韩毛片| eeuss国产一区二区三区| 激情av综合网| 蜜臂av日日欢夜夜爽一区| 亚洲精品中文在线观看| 欧美激情一区不卡| 久久香蕉国产线看观看99| 欧美一区二区免费| 6080亚洲精品一区二区| 在线精品亚洲一区二区不卡| 国产a区久久久| 国产黄色精品视频| 国产在线精品一区二区不卡了| 午夜a成v人精品| 亚洲成人你懂的| 亚洲制服丝袜在线| 亚洲国产综合人成综合网站| 亚洲美女在线一区| 一区二区三区在线影院| 亚洲激情自拍偷拍| 亚洲免费在线看| 亚洲精品免费一二三区| 成人欧美一区二区三区| 国产精品三级av在线播放| 国产片一区二区三区| 国产精品丝袜一区| 17c精品麻豆一区二区免费| 国产精品盗摄一区二区三区| 中文字幕日韩一区| 亚洲精品国产精品乱码不99| 亚洲一区二区三区四区的| 亚洲国产人成综合网站| 日韩国产在线观看一区| 日韩av在线播放中文字幕| 久久成人免费网| 国产一区二区成人久久免费影院| 国产乱码精品一区二区三区忘忧草| 国产乱子伦视频一区二区三区| 国产成人aaa| 91小视频免费观看| 欧美日韩国产综合久久| 日韩视频在线你懂得| 国产亚洲成年网址在线观看| 精品一区二区综合| 国产成人午夜99999| 99精品一区二区| 欧美三级中文字幕在线观看| 91精品福利在线一区二区三区 | 国产精品的网站| 一区二区三区精品| 美女视频免费一区| 国产精品66部| 欧美在线高清视频| 日韩精品中文字幕一区二区三区| 久久综合色一综合色88| 亚洲欧美日韩国产综合在线| 天使萌一区二区三区免费观看| 国产在线视频一区二区三区| 91在线国内视频| 日韩欧美在线不卡| 1000精品久久久久久久久| 日日摸夜夜添夜夜添国产精品| 狠狠v欧美v日韩v亚洲ⅴ| 一本一道久久a久久精品综合蜜臀| 欧美另类z0zxhd电影| 国产精品嫩草影院av蜜臀| 首页亚洲欧美制服丝腿| 国产91精品入口| 欧美一区二区三区啪啪| 综合在线观看色| 久久不见久久见免费视频7| 色噜噜狠狠成人网p站| 久久无码av三级| 夜夜嗨av一区二区三区网页 | 亚洲高清中文字幕| 91精品欧美久久久久久动漫 | 成人av综合一区| 欧美一区二区三区免费大片| 亚洲丝袜制服诱惑| 国产精品一区二区不卡| 91精品国产一区二区三区蜜臀 | 一区二区成人在线观看| 国产成人免费视频精品含羞草妖精| 91福利视频网站| 国产精品色呦呦| 国产美女娇喘av呻吟久久| 欧美一区二区视频网站| 亚洲一区二区在线视频| 99久久精品费精品国产一区二区| 日韩小视频在线观看专区| 亚洲综合色丁香婷婷六月图片| 国产成人8x视频一区二区| 精品久久久久久无| 全国精品久久少妇| 欧美精品电影在线播放| 夜夜精品视频一区二区 | 99re这里只有精品首页| 国产性天天综合网| 国产一区91精品张津瑜| 精品国产乱子伦一区| 麻豆国产91在线播放| 欧美一区二区三区婷婷月色| 婷婷夜色潮精品综合在线| 欧美三级电影网站| 亚洲午夜免费福利视频|