// ConsoleApplication60.cpp: определяет точку входа для консольного приложения.// #include "stdafx.h"#include<conio.h>#include"iostream"#include "stdio.h"#include "time.h" using namespace std; int main(){ int x, y,c; setlocale(LC_ALL, "RUS"); srand((unsigned)time(NULL)); x = rand() % 8 + 2; y = rand() % 8 + 2; cout << "Сколько будет " << x << "*" << y << "?" << "\n"; cout << "Введите ответ и нажмите Enter "; cin >> c; if (x*y == c) { cout << "Правильно\n"; } else { cout << "Вы ошиблись " << x << "*" << y << "=" << c; }return 0;}
Мунировна
23.02.2021
//PascalABC.Net function DelWord(s:string):string; var i,n:integer; begin n:=length(s); i:=n; repeat if i>=1 then Dec(i); until s[i]=' '; Delete(s,i+1,n-i); DelWord:=s end;
var st:string; begin Write('Введите строку: '); Readln(st); Writeln('Результат: ',DelWord(st)) end.
Тестовое решение: Введите строку: А роза упала на лапу Азора Результат: А роза упала на лапу
//PascalABC.Net function DescDigits(s:string):boolean; var desc:boolean; i,n:integer; c1,c2:char; begin n:=length(s); desc:=true; c1:='A'; { главное, чтобы символ был "старше" любой цифры } i:=1; repeat c2:=s[i]; if c2 in ['0'..'9'] then if c2<c1 then c1:=c2 else desc:=false; Inc(i) until (i>n) or (not desc); DescDigits:=desc end;
var s:string; begin Write('Введите строку: '); Readln(s); if DescDigits(s) then Writeln('true') else Writeln('false') end.
Тестовое решение: Введите строку: Пример строки с цифрами 98 по убыванию 7 6,5, так4тоже1можно! true
Вариант первой программы для Borland Pascal 7.01 uses Crt; function DelWord(s:string):string; var i,n:integer; begin n:=length(s); i:=n; repeat if i>=1 then Dec(i); until s[i]=' '; Delete(s,i+1,n-i); DelWord:=s end;
var st:string; begin ClrScr; Write('Введите строку: '); Readln(st); Writeln('Результат: ',DelWord(st)); ReadKey end.
нечего невидно что там