Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么Run Time Error... 郁闷

Posted by xttts at 2009-06-08 15:46:30 on Problem 1002
#include <iostream>
#include <iomanip>
using namespace std;

long int a[1000][10000];

void input1() {
  char c;
  long int i=1,n=0,m;
  while (i<=7) {
    cin>>c; 
	if (c=='-') continue;
    ++i;
	if ((c<='9') && (c>='0')) m=long int(c)-long int('0');
	else { 
	  if ((c>'Q')) c--;
	  m=(c-long int('A'))/3+2;
	}
    n=(n+m)*10;
  }
  n=n/10;
  a[n/10000][n%10000]++;
};

int main() {
  long int n,i,j;
  cin>>n;
  for (i=1;i<=n;i++) input1();
  cout<<setfill('0');
  for (i=0;i<=1000;i++)
   for (j=0;j<=10000;j++)
	 if (a[i][j]>1) {
	   cout<<setw(3)<<i;
	   cout<<setw(0)<<'-';
	   cout<<setw(4)<<j;
	   cout<<setw(0)<<' '<<a[i][j];
	   cout<<setw(0)<<endl;
	 }
  return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator