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() { int n,m,x; cin>>n>>m; for(int i=0;i<n;i++) { x=m; for(int j=0;j<i;j++) { cout<<" "; if(j<n-1) cout<<" "; } for(int k=0;k<n-j;k++) { if(x+k<=9) cout<<x+k; else cout<<x+k-9; if(k<n-1) cout<<" "; if(x+k+i<=9) x=x+k+i; else x=x+k+i-9; } if(x+i<=9) m=m+i+2; else m=m+i+2-9; cout<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator