Составить программу для определения по трем 1)сторонам равнобедренного или равностороннего или произвольного треугольника 2) )составить пр. для вычисления y если х> 0 то y=2, если х=0 то y=0, если х< 0 то y=x/2
Решение на qbasic cls input a input b input c if a=b and a=c and c=b then print "равносторонний" end end if if a< > b and a< > c and c< > b then print "разносторонний" else print "равнобедренный" end if
Pavlovna-Golovitinskaya378
02.09.2021
Var s: string; begin readln(s); //s : = ' дорогой мир шалаш кроет'; write('a) '); foreach s1: string in s.split(' ') do write(s1.; write(#13 + 'b) '); foreach s1: string in s.split(' ') do begin var b: boolean : = true; var i: byte : = 1; while (i < = length(s1) / 2) and b do begin b : = (s1[i] = s1[length(s1) - i + 1]); inc(i); end; if (not b) then write(s1, ' '); end; end.
sredova71121
02.09.2021
#include < iostream> #include < ctime> using namespace std; int main () { setlocale (0,"russian"); srand (time(null)); short n; int sum=0; int max=0; cout < < "n="; cin > > n; int *array=new int [n]; for (short i=0; i< n; i++) array[i]=rand()%201-100; cout < < "получившийся массив: " < < endl; for (short i=0; i< n; i++) { cout < < array[i] < < ' '; sum+=array[i]; } for (short i=0; i< n-1; i++) { if (max< array[i]) max=array[i]; } cout < < endl; cout < < "сумма элементов: " < < sum < < endl; cout < < "максимальное число: " < < max < < endl; system ("pause"); return 0; }