⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ss.cpp

📁 这是基于密码学的几个编程,很基础,但却是密码学中常用到的
💻 CPP
字号:
#include <stdio.h>
//#include <math.h>

void main()
{
	int a , r, b;
	int bottom = 12996;
	int A = 1;
	a = 227;
	int n[10];
	int i = 0;
	while( a != 0 )
	{
		b = a / 2;
		r = a % 2;
		n[i] = r;
		i ++;
		a = b;
	}

	for(int k = 0; k < i; k ++)
	{
		if(n[k] != 0)
		{
			A = (A * bottom) % 37909;
			bottom = (bottom * bottom) % 37909;
		}
		else
		{
			bottom = (bottom * bottom) % 37909;
		}
	}
	printf("(12996)227 ≡  %d (mod 37909) \n", A);
}

⌨️ 快捷键说明

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