encrypt.m

来自「有趣的可视的数值方法 出自网站http://www.mathworks.com」· M 代码 · 共 29 行

M
29
字号
function encrypt(filein,fileout)%ENCRYPT  Apply the CRYPTO function to a text file.%  ENCRYPT %      with no arguments prompts for a input file name.%  ENCRYPT inputfilename%      encrypts the text in the input file and displays the results.%  ENCRYPT inputfilename outputfilename%      stores the encrypted text in the output file.% See also CRYPTO.if nargin < 1   filein = input('Input file = ','s');endfin = fopen(filein);if nargin == 2   fout = fopen(fileout,'w');else   fout = 1;endwhile ~feof(fin)   s = fgetl(fin);   t = crypto(s);   fprintf(fout,'%s\n',t);endfclose all;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?