Rashidov Boysari 121 20-guruh


Download 43.67 Kb.
Sana21.04.2023
Hajmi43.67 Kb.
#1371995
Bog'liq
Shaxzod KI-modul


Rashidov Boysari 121_20-guruh

#include
using namespace std;
int gcd(int a, int b)
{
while (a - b != 0)
{
if (a > b)
a -= b;
else
b -= a;
}
return a;
}
int main()
{
int n;
cout<<"n= ",cin >> n;
int a[n], m;
for (int i = 0; i < n; i++)
{
cout<<"a["<> a[i];
}
m = a[0];
for (int i = 1; i < n; i++)
{
m = (m * a[i]) / gcd(m, a[i]);
}
cout << "EKUK = " << m << endl;
return 0;
}

Download 43.67 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling