Print settings
author off document
how many times it has been viewed
Answer:
c. your friend can hash all possible options and discover your secret.
Explanation:
SHA-256 is a set of hash functions that was designed by the NSA. SHA-2 is considered an upgrade on the set that was its predecessor, SHA-1. A hash is a mathematical function that condenses data in a process of one-way encryption. SHA-256 creates hash algoritms that are considered irreversible and unique. However, one of the properties of hashing algorithms is determinism, which means that any computer in the world would be able to compute a particular hash and get the same answer.
CTRL+P. It's usually pressed when you want to print something.
integer userInput
integer i
integer mid
integer array(20) number
userInput = 1
for i = 0; userInput >= 0; i = i + 1
if number[i] > -1
userInput = Get next input
number[i] = userInput
i = i - 1
mid = i / 2
if i > 9
Put "Too many inputs" to output
elseif i % 2 == 0
Put number[mid - 1] to output
else
Put number[mid] to output
Answer:
#include <iostream>
#include <array>
using namespace std;
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++)
if (toupper(str[i]) != toupper(str[length - 1 - i]))
return false;
return true;
}
int main()
{
array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };
for (auto test : tests) {
cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";
}
}
Explanation:
The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.