coffee2201
?>

Написать программу для вычисления площади ромба (s=1/2 d1d2 , где d1 и d2 - диагонали ромба)

Информатика

Ответы

arinaunknown6867
Var d1,d2: integer; s: real; begin read(d1,d2); s: =1/2*d1*d2; write('площадь равна ',s); end.
Ivan1568
1) typedef size_t uint32;   mt19937 gen{ };   uniform_int_distribution< uint32> uid(20, 100);   const uint32 n = 10;       int main()  {      uint32 arr[n], pos{0}, neg{0};       for (uint32 i = 0; i < n; ++i) {          arr[i] = uid(gen);           cout < < arr[i] < < " ";           if (arr[i] % 2 == 0) ++pos;           else ++neg;       }      cout < < endl < < pos < < "/" < < neg < < endl;       system("pause");   }2) typedef size_t uint32;   mt19937 gen{ };   uniform_int_distribution< uint32> uid(0, 100);   const uint32 n = 10;       int main()  {      uint32 arr[n], lf{ 0 }, hf{ 0 }, sum1{ 0 }, sum2{ 0 };       for (uint32 i = 0; i < n; ++i) {          arr[i] = uid(gen);           cout < < arr[i] < < " ";           if (arr[i] > = 50) {              ++lf;               sum1 += arr[i];           }  else {              ++hf;               sum2 += arr[i];           }      }      cout < < endl < < sum1 / lf < < "/" < < sum2 / hf < < endl;       system("pause");   }
Georgievna
#include < iostream> #include < time.h> #include < stdio.h> #include < stdlib.h> #define max 100using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { srand(time(null)); int n , chet = 0 ,notchet = 0 ,a[max]; cout< < "size : "; cin> > n; for(int i = 0; i < n; i++) { a[i] = rand()%120+20; cout< < a[i]< < endl; if (a[i] %2 == 0) chet++; else notchet++; } cout< < "chet = "< < chet< < ", notchet = "< < notchet; return 0; }

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

Написать программу для вычисления площади ромба (s=1/2 d1d2 , где d1 и d2 - диагонали ромба)
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

anikamalish
Svetlana1287
ryadovboxing
Irina_Chernyaev532
fancy-decor67
obitelsvel8
Ubuleeva826
rnimsk149
Александра Викторович531
vinokurova88251
Amulenkov
arturusinsk5
мурувватовна викторович569
olgaprevisokova302
allo22-27