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 <stdio.h> int main(int argc, char *argv[]) { int m,n,a,count=0,max,k,l,t; while(scanf("%d%d",&m,&n)!=EOF) { k=m; l=n; max=0; if(m>n) { t=m; m=n; n=t; } for(a=m;a<n;a++) { while(a!=1) { if(a%2==0) { a=a/2; count++; } else { a=3*a+1; count++; } } if(count>max) max=count; } printf("%d %d %d",k,l,max); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator