标签:scan pid logs rri nbsp return while int ring
http://acm.nyist.net/JudgeOnline/problem.php?pid=79
不明白哪儿有问题,有待验证
1 #include <stdio.h> 2 3 int floor = 0; 4 void recurring(int missile[],int begin,int size,int& cur){ 5 ++cur; 6 if(begin >= size - 1) 7 return ; 8 int i; 9 for(i = begin; i < size; i++){ 10 if(missile[i] < missile[begin]){ 11 recurring(missile,i,size,cur); 12 floor = (floor > cur) ? floor : cur; 13 --cur; 14 } 15 } 16 } 17 18 int main(){ 19 int N; 20 int m; 21 int missile[50]; 22 int i,cur; 23 scanf("%d",&N); 24 while(N--){ 25 scanf("%d",&m); 26 cur = 0; 27 for(i = 0; i < m; i++) 28 scanf("%d",&missile[i]); 29 recurring(missile,0,m,cur); 30 printf("%d\n",floor); 31 floor = 0; 32 } 33 return 0; 34 }
标签:scan pid logs rri nbsp return while int ring
原文地址:http://www.cnblogs.com/yfs123456/p/7506296.html