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

输入问题想了半天终于决定这样。。

Posted by ckcz123 at 2012-10-24 11:06:15 on Problem 1502
int n;
string s;
char ss[100];
cin >> n;
for (int i=2;i<=n;i++)
{
    for (int j=1;j<=i-1;j++)
    {
        cin >> s;
        memset(ss,'a',sizeof(ss));
        if (s=="x") a[i][j]=999999999;
        else
        {
            for (unsigned int k=0;k<=s.size()-1;k++) ss[k]=s[k];
            a[i][j]=atof(ss);
        }
    }
}
试验成功- -

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