|
|
вернуться в форумОбщий форумSimple popular program 1009 and WA? Why? Послано Kirill 2 фев 2006 18:26 Please help. Whats wrong?! #include <stdio.h> int Pow(int N,int K) { int P=1; while (N>0) { P=P*K; N--; }; return P; } int main() { int N,K; scanf("%d %d",&N,&K); if (N==1) printf("%d\n",Pow(N,K)); else if (N==2) printf("%d\n",Pow(N,K)-K); return 0; } |
|
|