[ create a new paste ] login | about

Link: http://codepad.org/lhPCYrPY    [ 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=3, m=2, n=7, res;

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


Output:
1
12


Create a new paste based on this one


Comments: