In arithmetic we often use the scheme called 'round up by five' to round up a decimal fraction number into a decimal integer number whose fraction part equals to or is bigger than 0.5, otherwise, its fraction part is discarded.
In this problem, you are to implement a similar sheme called 'round up by six'.
Input
The first line of the input is an integer N indicating the number of cases you are to process. Then from the second line there are N lines, each containing a number (may or may not be fractional).
Output
For each number in the input, you are to print the round-up-by-six version of the number in a single line.
Sample Input
2 25.599 0.6Sample Output
25 1
#include<iostream> #include<cmath> using namespace std; int main() {int n; cin>>n; while(n--) { double a; cin>>a; double b=floor(a); if(a-b>=0.6) cout<<b+1<<endl; else cout<<b<<endl; } return 0; }