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 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator