Amaliy qism
#include
#include
using namespace std;
int main()
{
double Sum=0, y=8, z=2;
int i=1;
while (i>=7)
{
Sum=//твоя функция//;
Sum++;
i++;
}
cout<<"Сумма ряда = "<return 0;
}
#include
#include
using namespace std;
size_t factorial(size_t n){
size_t res = 1;
if( n > 1 )
res = n*factorial(n - 1);
return res;
}
int main(){
float y = 8;
float z = 2;
float S = 0;
float f = 0;
for( size_t i = 1; i <= 7; i++ ){
f = pow(factorial(i) + y, 1.0f / i);//sqrt[i](i! + y)
f = f - pow(z, i*1.0f);//f - z^i
S = S + f;
}
cout<<"S = "<return 0;
}
Xulosa:
Men ushbu labaratoriya ishini bajarish davomida NP-to’liq masalalar.
NP-to’liq masalalarga keltirish usullari. Graf erkin uchlarini ajratish masalasi.
Kommivoyajer haqidagi masala Qatorlar yig’indisini hisoblash. To’plam ostilari yig’indisini hisoblashni o’rgandim.
Do'stlaringiz bilan baham: |