Geometrik shakllar :: Yechimlar

Masala A
Masala sharti

Kiritilgan burchak qiymatini 2 xona aniqlikda radianga o‘tkazadigan dastur tuzing.

Kiruvchi ma'lumot

-1000 dan 1000 gacha bo’lgan son

Chiquvchi ma'lumot

Kiritilgan burchakning radiandagi qiymati

#include <stdio.h>

int main() {
    int d;
    scanf("%d", &d);
    printf("%.2f", d * 3.14f / 180);
    
    return 0;
}
def main():
    d = int(input())
    print(f"{d * 3.14 / 180:.2f}")

if __name__ == '__main__':
    main()
Masala B
Masala sharti

Kiritilgan doira radiusidan kelib chiqib uning aylanasi uzunligi va doirasi yuzini 3 xona aniqlikda hisoblab ekranga chiqaradigan dastur tuzing.

Kiruvchi ma'lumot

0.01 dan 1000 gacha bo’lgan haqiqiy son

Chiquvchi ma'lumot

Birinchi qatorda doira aylanasi uzunligi, ikkinchi qatorda doira yuzasi

#include <stdio.h>

int main() {
    double PI = 3.14, r = 0;
    
    scanf("%lf", &r);
    printf("%.3f\n%.3f", 2 * PI * r, PI * r * r);

    return 0;
}
def main():
    PI = 3.14
    r = float(input())
    print(f"{2 * PI * r:.3f}")
    print(f"{PI * r ** 2:.3f}")

if __name__ == '__main__':
    main()
Masala C
Masala sharti

Balandligi va asosidan kelib chiqib uchburchak yuzini hisoblaydigan dastur tuzing.

Kiruvchi ma'lumot

Uchburchak balandligi va uning asosi 1 dan 1000 gacha.

Chiquvchi ma'lumot

Uchburcha yuzi 2 xona aniqlikda

#include <stdio.h>

int main() {
    int h, a;
    scanf("%d %d", &h, &a);
    printf("%.2f", h * a / 2.0f);

    return 0;
}
def main():
    h = int(input())
    a = int(input())
    print(f"{h * a / 2:.2f}")

if __name__ == '__main__':
    main()
Masala D
Masala sharti

Kiritilgan to’g’ri to’rtburchak tomonlaridan foydalanib uning perimetri va yuzasini hisoblaydigan dastur tuzing.

Kiruvchi ma'lumot

To’g’ri to’rtburchak tomonlari 1 dan 1000 gacha bo’shliq bilan ajratilgan holda

Chiquvchi ma'lumot

Uning perimetri va yuzasi bo’shliq bilan ajratilgan holda

#include <stdio.h>

int main() {
    int a, b;
    
    scanf("%d %d", &a, &b);
    printf("%d %d", 2 * (a + b), a * b);
    
    return 0;
}
def main():
    a, b = map(int, input().split())
    print(2 * (a + b), a * b)

if __name__ == '__main__':
    main()
Masala E
Masala sharti

5 dan 9 gacha bo’lgan sonlardan 5 ni ayiradigan dastur tuzing.

Kiruvchi ma'lumot

5 dan 9 gacha bo’lgan son

Chiquvchi ma'lumot

Kiritilgan sondan 5 ni ayirgandagi qiymat

,-----.