|
|
вернуться в форумWhy I got CE Please write wha am I getting CE: // Boxes #include <iostream.h> #include <math.h> int n, a, b; long num=0; int min(int a, int b) { if (a<b) return a; else return b; } int c(int il) { if (min(a, b)>il) return il+1; else return min(a, b)+1; } int count() { int i; for (i=a+b; i>=0; i--) { num += c(min(i, a+b-i)) * long(pow(double(n), double(i))); } cout << num; } int main() { cin >> n >> a >> b; count(); return 0; } Re: Why I got CE Послано 55555 1 авг 2003 14:13 coercive conversion must like this (long)pow(n,i). but your porgram is also WA. |
|
|