<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6287058316e0ca7141d34f49/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6287058316e0ca7141d34f49/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">#include<stdio.h></div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">#include<windows.h></div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">void main() </div><div class="t m0 x1 h3 y5 ff1 fs0 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x1 h3 y6 ff1 fs0 fc0 sc0 ls0 ws0">char p[1000]; </div><div class="t m0 x1 h3 y7 ff1 fs0 fc0 sc0 ls0 ws0">char c[1000]; </div><div class="t m0 x1 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">int k<span class="_ _0"></span>ey<span class="_ _1"></span>,i,m; </div><div class="t m0 x1 h3 y9 ff1 fs0 fc0 sc0 ls0 ws0">k<span class="_ _0"></span>ey=5; </div><div class="t m0 x1 h4 ya ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">定义一个移位个数为<span class="_ _2"> </span></span>5<span class="ff2">,即加密向右移<span class="_ _2"> </span></span>5<span class="_"> </span><span class="ff2">位,解密则相反</span>*/ </div><div class="t m0 x1 h3 yb ff1 fs0 fc0 sc0 ls0 ws0">prin&("please input the Plainte<span class="_ _0"></span>xt:
"); </div><div class="t m0 x1 h3 yc ff1 fs0 fc0 sc0 ls0 ws0">gets(p); </div><div class="t m0 x1 h4 yd ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">读取字符<span class="_ _3"></span>串,直至接受<span class="_ _3"></span>到换行符停止<span class="_ _3"></span>,并将读取的结果<span class="_ _3"></span>存放在<span class="_ _4"> </span></span>p[1000]<span class="ff2">中。换<span class="_ _3"></span>行符不作为</span></div><div class="t m0 x1 h4 ye ff2 fs0 fc0 sc0 ls0 ws0">读取串的内容,读取的换行符被转换为<span class="_ _2"> </span><span class="ff1">null<span class="_"> </span></span>值,并由此来结束字符串。<span class="ff1">*<span class="_ _0"></span>/ </span></div><div class="t m0 x1 h3 yf ff1 fs0 fc0 sc0 ls0 ws0">for(i=0;p[i]!=' ';i++) </div><div class="t m0 x1 h3 y10 ff1 fs0 fc0 sc0 ls0 ws0">c[i]=(p[i]-'a'+k<span class="_ _0"></span>ey)%26+'a'; </div><div class="t m0 x1 h4 y11 ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">加密算法,所有明文符号由向右移<span class="_ _2"> </span></span>5<span class="_"> </span><span class="ff2">位的密文代替</span>*/ </div><div class="t m0 x1 h3 y12 ff1 fs0 fc0 sc0 ls0 ws0">c[i]=' '; </div><div class="t m0 x1 h3 y13 ff1 fs0 fc0 sc0 ls0 ws0">prin&("the Cipherte<span class="_ _0"></span>xt <span class="_ _3"></span>is:
%s
",c); </div><div class="t m0 x1 h4 y14 ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">输出加密后的密文</span>*/ </div><div class="t m0 x1 h3 y15 ff1 fs0 fc0 sc0 ls0 ws0">prin&("please input the Ciptert<span class="_ _0"></span>ext:
"); </div><div class="t m0 x1 h3 y16 ff1 fs0 fc0 sc0 ls0 ws0">gets(c); </div><div class="t m0 x1 h4 y17 ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">读取<span class="_ _3"></span>字符串<span class="_ _3"></span>,直至<span class="_ _3"></span>接受到换<span class="_ _3"></span>行符停<span class="_ _3"></span>止,并<span class="_ _3"></span>将读取<span class="_ _3"></span>的结果存<span class="_ _3"></span>放在<span class="_ _5"> </span></span>c[1000]<span class="ff2">中<span class="_ _3"></span>。换行<span class="_ _3"></span>符不作为</span></div><div class="t m0 x1 h4 y18 ff2 fs0 fc0 sc0 ls0 ws0">读取串的内容,读取的换行符被转换为<span class="_ _2"> </span><span class="ff1">null<span class="_"> </span></span>值,并由此来结束字符串。<span class="ff1">*<span class="_ _0"></span>/ </span></div><div class="t m0 x1 h3 y19 ff1 fs0 fc0 sc0 ls0 ws0">for(i=0;c[i]!=' ';i++) </div><div class="t m0 x1 h3 y1a ff1 fs0 fc0 sc0 ls0 ws0">p[i]='z'-('z'+k<span class="_ _0"></span>ey-c[i])%26; </div><div class="t m0 x1 h4 y1b ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">解密算法,所有明文符号由向左移<span class="_ _2"> </span></span>5<span class="_"> </span><span class="ff2">位的明文代替</span>*/ </div><div class="t m0 x1 h3 y1c ff1 fs0 fc0 sc0 ls0 ws0">p[i]=' '; </div><div class="t m0 x1 h3 y1d ff1 fs0 fc0 sc0 ls0 ws0">prin&("the Plaint<span class="_ _0"></span>ext is:
%s
",p); </div><div class="t m0 x1 h4 y1e ff1 fs0 fc0 sc0 ls0 ws0">/*<span class="ff2">输出解密后的明文</span>*/ </div><div class="t m0 x1 h3 y1f ff1 fs0 fc0 sc0 ls0 ws0">sy<span class="_ _0"></span>stem("pause");</div><div class="t m0 x1 h3 y20 ff1 fs0 fc0 sc0 ls0 ws0">return; </div><div class="t m0 x1 h3 y21 ff1 fs0 fc0 sc0 ls0 ws0">}</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>