ОбъясОтличник
program prog;
uses crt;
var a,b,v:integer;
begin
clrscr;
write('Возраст Антона = ');
readln(a);
write('Возраст Бориса = ');
readln(b);
write('Возраст Виктора = ');
readln(v);
writeln;
if (a>b)and(a>v) then writeln('Антон старше всех.');
if (b>a)and(b>v) then writeln('Борис старше всех.');
if (v>a)and(v>b) then writeln('Виктор старше всех.');
if (a=b)and(a>v) then writeln('Антон и Борис старше Виктора');
if (a=v)and(a>b) then writeln('Антон и Виктор старше Бориса');
if (b=v)and(b>a) then writeln('Борис и Виктор старше Антона');
if (a=b)and(a=v) then writeln('Антон,Борис и Виктор одного возраста');
end.
Подробнее - на -
/* main program fucntion */void main(){ int iMatrSize, // size of the matrix iSum = 0, // sum of the nessesary elements of the matrix iCnt = 0, // number of the nessesary elements of the matrix **aMatr; // the matrix int i, j;
scanf_s("%i", &iMatrSize);
/* allocation memory for the array */ aMatr = (int**)malloc(sizeof(int) * iMatrSize); for (i = 0; i < iMatrSize; i++) { aMatr[i] = (int*)malloc(sizeof(int) * iMatrSize); }
/* filling in the array */ for (i = 0; i < iMatrSize; i++) for (j = 0; j < iMatrSize; j++) aMatr[i][j] = rand() % 21 - 10;
/* counting the sum of the elements */ for (i = 0; i < iMatrSize; i++) for (j = 0; j < iMatrSize - i - 1; j++) iSum += aMatr[i][j], iCnt++;
/* outputing the array */ for (i = 0; i < iMatrSize; i++) { for (j = 0; j < iMatrSize; j++) printf ("%3i ", aMatr[i][j]); printf("\n"); }
printf("Sum = %f\n", (float)iSum / iCnt);
_getch();} /* End of 'main' function */