| ||||||||||
| 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:请高手指点一下!!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator