Условное форматирование - Своя формула
=B1="красный"
int main() {
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
string message;
const int block_size = 8;
int key[block_size];
cout << "Введите текст: ";
cin >> message;
for (int i = 0; i < message.length()%block_size; i++){
message+= "_"; // default symbol
};
cout << "Введите ключ через пробел(размер ключа: " << block_size << " ): ";
for (int i = 0; i < block_size; i++)
{
cin >> key[i];
}
string encrypt_message = "";
int text_length = message.length();
for (int block_index = 0; block_index <= text_length/block_size; block_index++) {
for (int offset = 0; offset < block_size; offset++) {
encrypt_message += message[block_index*block_size + key[offset] - 1];
};
};
cout << "Зашифрованный текст: " << encrypt_message;
_getch();
return 0;
}
const ready = () => {
let elem = document.querySelector('.hi');
elem.innerText = +elem.innerText+100;
};
document.addEventListener("DOMContentLoaded", ready);
const getNums = string => {
return string.split(/[+*\/-]/g).map(num => num.trim);
};
const getNums = string => {
return string.split(/[+*\/-]/g).map(num => num.trim());
};
const nums = getNums(string);
// ...
nums = nums.map(num => romanToArabic(num));
var newtext = document.createTextNode(text);
var p1 = document.getElementById("p1");
p1.appendChild(newtext);
// https://code.jquery.com/jquery-3.5.0.js
/**
* Load a url into a page
*/
jQuery.fn.load = function( url, params, callback ) {
var selector, type, response,
self = this,
off = url.indexOf( " " );
if ( off > -1 ) {
selector = stripAndCollapse( url.slice( off ) );
url = url.slice( 0, off );
}
// If it's a function
if ( isFunction( params ) ) {
// We assume that it's the callback
callback = params;
params = undefined;
// Otherwise, build a param string
} else if ( params && typeof params === "object" ) {
type = "POST";
}
// If we have elements to modify, make the request
if ( self.length > 0 ) {
jQuery.ajax( {
url: url,
// If "type" variable is undefined, then "GET" method will be used.
// Make value of this field explicit since
// user can override it through ajaxSetup method
type: type || "GET",
dataType: "html",
data: params
} ).done( function( responseText ) {
// Save response for use in complete callback
response = arguments;
self.html( selector ?
// If a selector was specified, locate the right elements in a dummy div
// Exclude scripts to avoid IE 'Permission Denied' errors
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}
return this;
};
let elem = document.getElementsByName('body')[0]; // ищем по имени или любым другим способом
if (elem){
elem.oninput = ()=>{
const wordsCount = 5; // количество "слов"
const delimiter = ","; // разделитель "слов"
const attributeName = "oldValue"; // атрибут для хранения старого значения
if (elem.value.split(delimiter).length<=(wordsCount-1)){
console.log("save good value");
elem.setAttribute(attributeName, elem.value);
}else{
console.log("wrong input");
let oldValue = elem.getAttribute(attributeName);
if (oldValue!==undefined){
console.log("return old value");
elem.value = oldValue;
}else{
console.log("return default value");
elem.value = "";
elem.setAttribute(attributeName, elem.value);
};
};
};
};
без уменьшения количества формул
мне нужны только csv-шки