Amaliy ish boyicha variantlaridagi misollar i-topshiriq
Download 57.3 Kb.
|
Behruz
Amaliy ish boyicha variantlaridagi misollar I-TOPSHIRIQ 6) a=-2; b=1,14; c=2,5. #include using namespace std; float f(int x, int y) { return (1 + 2 * x * y + 4 * pow(x, 2) * pow(y, 2)); } int main() { float a, b, c, W; cout << "a="; cin >> a; cout << "b="; cin >> b; cout << "c="; cin >> c; W = pow((1 / tan(f(a, b))), 2) + pow((f(b, c)), 7) - log(f(a, c)); cout << "W=" << W << endl; return 0; } Sonni sakkizlik sanoq sistemasidan ikkilik sanoq sistemasiga o‘tkazuvchi funksiya tuzing. #include using namespace std; long long sakkizlikdanikkilikga(int n) { int a = 0, i = 0; long long ikkilikda = 0; while (n != 0) { a += (n % 10) * pow(8, i); ++i; n /= 10; } i = 1;
while (a != 0) { ikkilikda += (a % 2) * i; a /= 2; i *= 10; } return ikkilikda; } int main() { int n; cout << "Sakkizlik sanoq sistemasidagi son kiriting: "; cin >> n; cout << n << " sakkizlik sanoq sistemasidan ikkilik sanoq sistemasida = " << sakkizlikdanikkilikga(n) << endl; return 0; } Download 57.3 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling