Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:请问一下 1003题中 我编的程序中 没有编译错误但出现编译框后 输人任何数据 程序会自动结束 这是什么原因呢? 帮我解决一下 谢谢

Posted by suixinpiaodang at 2011-04-10 23:35:00
In Reply To:请问一下 1003题中 我编的程序中 没有编译错误但出现编译框后 输人任何数据 程序会自动结束 这是什么原因呢? 帮我解决一下 谢谢 Posted by:suixinpiaodang at 2011-04-10 23:29:44
> #include<stdio.h>
> int main()
> {
> float a;
> int max;
> int howfar(int max);
> return 0;
> }
> int howfar(int  max){
> 
> 	float s,a;
> while(1)
> { 
> 	scanf("%d\n",&a);
> 	if(a<=0.50){
> 		max=1;
> 		printf("%d card(s)\n",max );}
> 	else{
> 		for(int i=3,max=2;s<=a;i++)
> 		{          
> 			
> 			
> 			s=1/2;
> 			s=s+1/i;
> 			max++;
> 			printf("%d card(s)\n",max );
> 			if(a==0.00)
> 			break;
> 				}
> 			}
> }
> }
> 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator