Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:晕~~~~~~以为是负的就不算呢In Reply To:晕~~~~~~以为是负的就不算呢 Posted by:gxjloveyu at 2009-07-28 10:48:11 负的不用算! #include<stdio.h> int f(int n,int m) {int w=1; while(m) {w*=n; m--; } return w; } int main() {int n,x,y,i,a[100],s=0; scanf("%d",&n); scanf("%d",&x); for(i=0;i<n;i++) {scanf("%d",&a[i]); y=f(a[i],x); if(y>0) s+=y; } printf("%d",s); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator