[ create a new paste ] login | about

Link: http://codepad.org/223IQAaa    [ raw code | output | fork ]

C++, pasted on Apr 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <cmath>
 
using namespace std;

int main(void)
{
    double k=2, m=1, n=3, res;

    res = (ceil(n/k) * 2 * m);
    cout<<res;
    
    return 0;
}


Output:
1
4


Create a new paste based on this one


Comments: