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 |
帮我看看,哪儿错了!#include<iostream> using namespace std; int findx(int *a,int n,int q) { for(int i=0;i<n;i++) if(a[i]==q) return 1; return 0; } int main() { int n,counta=0; int a, q[10001],x ,sum=0,temp=0; int tep=0; scanf("%d",&n); for( int i=0;i<n;i++) { cin>>q[i]>>a>>x; if(a==0) sum+=10; if(i>=1) tep=findx(q,i,q[i]); if(i<1) { if(a==1&&x==0) sum+=20; if(a==1&& x==1 ) sum+=40; } if(tep==1&&i>=1) { if(a==1&&x==0&&counta==0) sum+=20; if(a==1&&x==0&&counta>0) sum+=30; if(a==1&& x==1 &&counta==0) sum+=40; if(a==1 && x==1&& counta>0) sum+=50; } if(tep==0&&i>=1) { counta=0; if(a==1&&x==0) sum+=20; if(a==1&& x==1 ) sum+=40; } if(a==1) counta+=1; } cout<<sum<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator