C++ va Python Oraliq savollariga javoblar
I-variant
1.
2.
#include
#include
using namespace std;
int main()
{
int n,s=0;
cout << "n ni kiriting:"; cin >> n;
for (int i=0; i<=n; i++) {
s+=pow(n+i,3);
}
cout << "Yig'indi S=" << s <return 0;
}
3.
#include
#include
using namespace std;
int main()
{
int a,b,c,d1,d2;
cout << "Birinchi sonni kiriting:"; cin >> a;
cout << "Ikkinchi sonni kiriting:"; cin >> b;
cout << "Uchinchi sonni kiriting:"; cin >> c;
d1=min(a,b);
d2=min(d1,c);
cout << "Eng kichigi min=" << d2 << endl;
return 0;
}
4.
#include
using namespace std;
int main()
{
int A=-1, B=2.4;
double x,K;
cout << "x ni kiriting:"; cin >> x;
double f1=(A*x-x*x)/(2-4*x*x);
double f2=(A+B)*x-x*x-A*B;
double f3=(B-x)/(x+5*x);
if (xelse if ((A<=x)&&(xelse {K=f3;}
cout << "Natija: K=" << K << endl;
return 0;
}
Do'stlaringiz bilan baham: |