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:请高手指点一下!!

Posted by cpp051000448076 at 2005-04-29 00:23:09 on Problem 1218
In Reply To:请高手指点一下!! Posted by:90401552 at 2004-12-24 19:52:15
> #include <stdio.h>
> int func1(int x) {
> 	int i,c;
> 	for(i=2;i<=x;i++){
> 		c=0;
> 		if(!(x%i)) c=c+1;
> 	}
> 	if(c%2) return 0;
> 	else return 1;
> }
> int func2(int y) {
> 	int j,r;
> 	for(j=2;j<=y;j++){
> 		r=1;
> 		r=r+func1 (j);
> 	}
> 	return r;
> }
> int main(){
> 	int i,n,t;
> 	scanf("%d",&t);
> 	    for(i=1;i<=t;i++){
> 	    	scanf("%d",&n);
> 			printf("%d\n",func2(n));
> 		}
> 	return 0;
> }
> 为什么总是输出1???

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