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 thomas_wu at 2009-03-01 13:13:42 on Problem 3173
#include<iostream>
using namespace std;

int main()
{
    char tri[21][21]={' '};
    int n;
    char s;
    cin>>n>>s;
    char x=s;
    for(int j=1;j<=n;j++)
       for(int i=1;i<=j;i++){
          tri[i][j]=x;
          x++;
          if(x>'9')x='1';
    }
    for(int i=1;i<=n;i++){
       for(int j=1;j<=n;j++){
               cout<<tri[i][j];
               if(j!=n)cout<<' ';
       }
       if(i!=n)cout<<endl;
    }
}

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