| ||||||||||
| 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 | |||||||||
我的RE啊,请大牛指点~~~#include <iostream>
using namespace std;
#define N 10
#define M 100
int main(){
int numseq[M][M];
int test[N+1];
int t=0;
while(cin>>test[t++]&&t<=test[0]);
for(int i=0;i<M;i++){
for(int j=0;j<=i;j++)
numseq[i][j]=j+1;
}
int row=0,col=0;
int k=1;
int l=1;
while(l<=test[0]){
while(k<test[l]){
if(col<row) col++;
else{row++;col=0;}
k++;
}
cout<<numseq[row][col]<<endl;
l++;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator