#include <iostream>
int main() {
int count = 0;
long num;
std::cout << "Введите ваше число: ";
std::cin >> num;
int previous1 = -1;
int previous2 = -1;
int current;
while (num > 0) {
current = num % 10;
num /= 10;
if (previous2 == 7 && previous1 == 7 && current == 7) {
count += 1;
break;
}
previous2 = previous1;
previous1 = current;
}
if (count > 0) {
std::cout << 'T' << std::endl;
} else {
std::cout << 'F' << std::endl;
}
return 0;
}
void MyTextEdit::contextMenuEvent(QContextMenuEvent *event) {
QPoint mousePos = event->pos();
QTextCursor cursor = cursorForPosition(mousePos);
int blockNumber = cursor.blockNumber();
QMenu *menu = createStandardContextMenu();
menu->addAction(QString("Строка: %1").arg(blockNumber + 1));
menu->exec(event->globalPos());
delete menu;
}
#include <stdio.h>
#include <stdlib.h>
int main() {
char str[12];
double number = 0;
printf("Enter a number to edit: ");
gets(str);
int i = 0, j = 0;
char editedStr[12];
int dot_found = 0;
printf("Entered number : %s\n", str);
while (str[i] != '\0') {
if (str[i] == ',' || str[i] == '.') {
if (!dot_found) {
editedStr[j++] = '.';
dot_found = 1;
}
} else {
editedStr[j++] = str[i];
dot_found = 0;
}
++i;
}
editedStr[j] = '\0';
printf("Edited number but not converted: %s\n", editedStr);
number = atof(editedStr);
printf("Edited number: %f\n", number);
return 0;
}