Untitled

 avatar
user_0563559
c_cpp
7 months ago
204 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	float a, b;
	int sum;
	cin >> a;

	b = a - int(a);

	if (b >= 0.5) {
		sum = a + b;
	}
	else {
		sum = a - b;
	}
	cout << sum;
}
Leave a Comment