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> #include<cstring> using namespace std; char a[30][30]; int main() { int n,s; while(cin>>n>>s) { memset(a,' ',sizeof(a));s+=48; for(int i=0;i<n;i++) for(int j=0;j<=i;j++) a[j][i]=s,s=s==57?49:s+1; for(int i=0,k=s;i<n;i++) for(int j=0;j<n;j++) cout<<a[i][j]<<(j==n-1?'\n':' '); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator