This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def printPyramid(num): | |
data = list(range(1, num)) + list(range(num, 0, -1)) | |
for i in data: | |
result = ' ' * (i-1) | |
if i == 1: | |
result += ''.join(str(x) for x in data) | |
else: | |
result += ''.join(str(x) for x in data[i-1:-i+1]) | |
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RC4 { | |
public static byte[] Encrypt(byte[] pwd, byte[] data) { | |
int a, i, j, k, tmp; | |
int[] key, box; | |
byte[] cipher; | |
key = new int[256]; | |
box = new int[256]; | |
cipher = new byte[data.Length]; |