| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 946 人关注过本帖
标题:[讨论]关于加密解密,用异或运算
只看楼主 加入收藏
jason_191919
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-3-12
收藏
 问题点数:0 回复次数:2 
[讨论]关于加密解密,用异或运算

编个程序,用户输入的一个字符加密后输出,当用户输入密码的时候将字符解密输出 ,不知道哪里出现问题了 ?
#include<iostream.h>
void main()
{
char a,b,c,d;
c=(a^b);
a=(c^b);
cout<<"please input the numbers you want to be secreted:"<<endl;
cin>>a;
cout<<"please input the password:"<<endl;
cin>>b;
cout<<c<<endl;
cout<<"if you want to get the number,please input the password:"
cin>>d;
if (c==d)
cout<<a<<endl;
else
cout<<"erro!please input the password again"
}


搜索更多相关主题的帖子: cout input please endl 
2006-04-12 19:46
gototheworld
Rank: 1
等 级:新手上路
帖 子:218
专家分:0
注 册:2006-3-24
收藏
得分:0 

cout<<"if you want to get the number,please input the password:" ;
...
cout<<"erro!please input the password again" ;

路漫漫其修远兮 吾将上下而求索
2006-04-12 22:25
ElfDN
Rank: 4
等 级:贵宾
威 望:11
帖 子:291
专家分:0
注 册:2005-11-13
收藏
得分:0 
你的操作顺序就有问题呀,a,b都没输入你怎么弄的c?输出的大概一直是同一个数吧,还少那么多分号

2006-04-13 08:05
快速回复:[讨论]关于加密解密,用异或运算
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029056 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved