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 |
C语言大虾请看为什么总是Runtime Error#include <stdio.h> int v[10000][2],k; int nohave (x,y) { int n; if (k!=0) for (n=0;n<k;n++) if (x==v[n][0]&&y==v[n][1]) return n; v[k][0]=x; v[k][1]=y; k++; return 0; } int main() { long mon[100]; long money,mo; int x,y,i,j,m,n,r,p; scanf ("%d",&p); for (i=0;i<p;i++) { scanf("%c",&k); scanf("%d %d %d",&n,&m,&r); money=(n+m)*10000.0; for (j=0;j<r;j++) { scanf("%d %d %ld",&x,&y,&mo); if (!nohave(x,y)) money-=mo; } mon[i]=money; } for (i=0;i<p;i++) printf("%ld\n",mon[i]); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator