A - Thermometer
Source: atcoder
Difficulty: 100

Problem Statement
Takahashi measured his body temperature and found it to be
X
{}^\circ
C.
Body temperature is classified into the following:
Higher than or equal to
38.0
{}^\circ
C: “High fever”
Higher than or equal to
37.5
{}^\circ
C and lower than
38.0
{}^\circ
C: “Fever”
Lower than
37.5
{}^\circ
C: “Normal”
Which classification does Takahashi's body temperature fall into? Present the answer as an integer according to the Output section.
Constraints
30 \leq X \leq 50
X
is given to one decimal place.
Input
The input is given from Standard Input in the following format:
X
Output
Print an integer specified below corresponding to Takahashi's body temperature classification.
High fever:
1
Fever:
2
Normal:
3
Sample Input 1
40.0
Sample Output 1
1
His body temperature is
40.0
{}^\circ
C, which is classified as a high fever. Thus, print
1
.
Sample Input 2
37.7
Sample Output 2
2
His body temperature is
37.7
{}^\circ
C, which is classified as a fever. Thus, print
2
.
Sample Input 3
36.6
Sample Output 3
3
His body temperature is
36.6
{}^\circ
C, which is classified as a normal temperature. Thus, print
3
.

C++ solution:
#include<bits/stdc++.h>
using namespace std;
const char n1='\n',n2=' ';
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,n,a) for (int i=n;i>=a;i--)
#define de1(a) cout<<#a<<" = "<<a<<n1;
#define de2(a) cout<<#a<<" = "<<a<<n2;
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define all1(x) (x).begin()+1,(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define sz0(x) sz(x)-1
#define me(a,x) memset(a,x,sizeof(a))
//#define int long long 
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<double> vd;
typedef vector<string> vs;
typedef map<int,int> mii;
typedef array<ll,3> a3;
template <typename T>
bool chmax(T &a, T b) {
    return a < b ? (a = b, true) : false;
}
template <typename T>
bool chmin(T &a, T b) {
    return a > b ? (a = b, true) : false;
}
//typedef __int128 i128;
const int N=200010;
const int inf=2e9;
void solve(){ 
    double x;
    cin>>x;
    int ans=1;
    if(x<38){
    	ans++;
    }
    if(x<37.5){
    	ans++;
    }
    cout<<ans;
}   
signed main(){
    ios::sync_with_stdio(0),cin.tie(0);
    int T=1;
    // cin>>T;
    while(T--)solve();
    return 0;
}

Go solution:
package main

import(
  "fmt"
)

func main(){
  var x float64
  fmt.Scan(&x)
  
  switch {
    case x>=38.0:
      fmt.Println(1)
    case x<37.5:
      fmt.Println(3)
    default:
      fmt.Println(2)
  }
}

Java solution:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) {
		String str1;
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			str1 = br.readLine();
		}catch (Exception e) {
			System.out.println("Input Error!!");
			return;
		}
		String[] sa = str1.split(" ");
		ArrayList<Double> il = new ArrayList<Double>();
		for(String s:sa) {
			il.add(Double.parseDouble(s));
		}
		aThermometer(il);
	}
	private static void aThermometer(ArrayList<Double> il) {
		double value = il.get(0);
		if(value >= 38.0) {
			System.out.println(1);
			return;
		}
		if(value >= 37.5) {
			System.out.println(2);
			return;
		}
		if(value < 37.5) {
			System.out.println(3);
			return;
		}
	}
}

JavaScript solution:
let val = ""

process.stdin.on("data", function (chunk) {
  val += chunk
})

process.stdin.on("end", function () {
  main(val)
})

function main(val) {
  let input = val.split("\n")
  let t = 0
  // const tc = Number(input[t++])
 const x=Number(input[t++])
 if(x >= 38) console.log(1)
 else if(x >= 37.5 && x <38) console.log(2)
 else console.log(3)
}

Python solution:
x=float(input())
if x>=38:
    print(1)
elif 38>x>=37.5:
    print(2)  
else:
    print(3)

Ruby solution:
def main
  n = gets.chomp.to_f
  
  if n >= 38
    puts 1
  elsif n >= 37.5 && 38 > n
    puts 2
  else
    puts 3
  end
end

main