(字符串的模式匹配4.7.8)UVA 10008 What's Cryptanalysis?(统计文本中某一个字符的出现的次数,需要从小到大排序&&同次数的按字段序排序)

/*
 * UVA_10008.cpp
 *
 *  Created on: 2013年10月26日
 *      Author: Administrator
 */

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string.h>


using namespace std;

struct inf{
	int num, id;
}a[30];

bool cmp(inf x, inf y) {
	if(x.num != y.num) return x.num > y.num;
	return x.id < y.id;
}


int main(){
	int n;
	char s[1000];
	while(scanf("%d",&n)!=EOF){
		int i,j;
		for(i = 0 ; i < 26 ; ++i){
			a[i].id = i;
			a[i].num = 0;
		}

		gets(s);
//		scanf("%s",&s);
		for(i = 0 ; i < n ; ++i){

//			scanf("%s",&s);
			gets(s);
			for(j = 0 ; j < strlen(s);++j){
				if(isalpha(s[j])){//判断该字符是否是字母,排除空格符及?号等情况
					a[tolower(s[j]) - 'a'].num++;//tolower(s[j])将所有字符都穿换成小写
				}
			}
		}

		sort(a,a+26,cmp);

		for(i = 0 ; i < 26 ; ++i){
			if(a[i].num !=0){

				printf("%c %d\n",(a[i].id +'A'),a[i].num);
			}
		}
	}

	return 0;
}


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,以下是20篇与密码S盒代数性质检测软件有关的参考文献: 1. "Automatic Generation of Algebraic Properties for S-Box Based Cryptographic Primitives" by Léo Ducas, et al. (2012) 2. "On the Evaluation of Algebraic Properties of S-Boxes" by Yosuke Todo and Tetsu Iwata (2015) 3. "Algebraic Evaluation of S-Boxes and Their Cryptographic Properties" by Anne Canteaut, et al. (2016) 4. "New Techniques for Algebraic Cryptanalysis of Block Ciphers with S-Box" by Takanori Isobe, et al. (2017) 5. "Algebraic Cryptanalysis of the Lightweight Block Cipher Piccolo-80" by Yosuke Todo and Tetsu Iwata (2013) 6. "Algebraic Cryptanalysis of the Block Cipher PRESENT" by Martin Albrecht, et al. (2010) 7. "Algebraic Cryptanalysis of the Secret S-Box of Bluetooth" by Alex Biryukov, et al. (2005) 8. "A SAT-based Method for Algebraic Cryptanalysis of Block Ciphers with S-Box" by Takanori Isobe, et al. (2016) 9. "Algebraic Cryptanalysis of the Stream Cipher Trivium" by Martin Albrecht and Gregor Leander (2012) 10. "Algebraic Cryptanalysis of the Block Cipher KATAN" by Alex Biryukov, et al. (2010) 11. "Algebraic Cryptanalysis of the Block Cipher CLEFIA" by Martin Albrecht, et al. (2011) 12. "Cryptanalysis of Some Lightweight Block Ciphers with Linear and Differential Cryptanalysis and Their Algebraic Structure" by Takanori Isobe and Yosuke Todo (2013) 13. "Algebraic Cryptanalysis of the Tweakable Block Cipher TSC-4" by Takanori Isobe and Yosuke Todo (2015) 14. "Algebraic Cryptanalysis of the Block Cipher HIGHT" by Takanori Isobe, et al. (2011) 15. "Algebraic Cryptanalysis of the Stream Cipher Grain-128" by Martin Albrecht and Gregor Leander (2010) 16. "Efficient Algebraic Cryptanalysis of Small Scale AES" by Alex Biryukov, et al. (2009) 17. "Algebraic Cryptanalysis of the Stream Cipher MICKEY" by Martin Albrecht, et al. (2010) 18. "Algebraic Cryptanalysis of the Block Cipher Camellia" by Martin Albrecht, et al. (2011) 19. "Algebraic Cryptanalysis of the Block Cipher MISTY1" by Martin Albrecht, et al. (2011) 20. "Algebraic Cryptanalysis of the Block Cipher AES" by Alex Biryukov, et al. (2009) 希望这份参考文献能对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

帅气的东哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值