|
|
back to boardWhat's wrong in this code? Posted by daniel 24 Sep 2011 12:46 I don't understand what's wrong with this code? #include <cstdlib> #include <iostream> using namespace std; int main() { int n, k; while (scanf("%d %d", &n, &k) != EOF) { if(n<<1<k)n=1; else if((n<<1)%k>0)n=((n<<1)/k)+1; else n=(n<<1)/k; printf("%d\n", n); } return 0;
} |
|
|