Created
July 18, 2025 14:48
-
-
Save davit312/7e9cabde9935021cad411cbab8503338 to your computer and use it in GitHub Desktop.
Մարմնի զանգվածի ինդեքսի հաշվիչ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var ( | |
height float32 | |
weight float32 | |
index float32 | |
) | |
fmt.Println(` | |
Զանգվածի ինդեքսի հաշվիչ. | |
բանաձեւը․ քաշ(կգ)/հասակ(մ)*հասակ(մ) | |
`) | |
for { | |
fmt.Print("Գրեք քաշը (կգ)։ ") | |
fmt.Scan(&weight) | |
fmt.Print("Գրեք հասակը (սմ)։ ") | |
fmt.Scan(&height) | |
if height > 0 && weight > 0 { | |
break | |
} | |
} | |
height /= 100 // convert to meters | |
index = float32(weight / (height * height)) | |
fmt.Printf("\nՄարմնի զանգվածի ինդեքսը։ %.2f\n", index) | |
fmt.Print(` | |
-------------------- | |
-------------------- | |
| Ինդեքսի միջակայք | Կատեգորիա | Առողջական վիճակի գնահատական | | |
|--------------------|--------------------------|-----------------------------| | |
| < 18.5 | Թերքաշություն | Անբավարար քաշ | | |
| 18.5 - 24.9 | Նորմալ քաշ | Առողջ միջակայք | | |
| 25.0 - 29.9 | Ավել քաշ | Բարձր ռիսկ | | |
| 30.0 - 34.9 | Ճարպակալում (I աստիճան) | Շատ բարձր ռիսկ | | |
| 35.0 - 39.9 | Ճարպակալում (II աստիճան)| Ծայրահեղ բարձր ռիսկ | | |
| ≥ 40.0 | Ճարպակալում (III աստիճան)| Կյանքին վտանգ սպառնացող | | |
`) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment