码迷,mamicode.com
首页 > 其他好文 > 详细

2053——switch game

时间:2014-11-05 14:29:02      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   for   sp   div   

http://acm.hdu.edu.cn/showproblem.php?pid=2053

思路:根据n=5的图,可以知道,就是判断n可以被1-n里的数整除多少次。。

#include<stdio.h>
int main(){
    int k,j,n;
    while(scanf("%d",&n)!=EOF){
    int k=0;
    for(j=1;j<=n;j++){
        if(n%j==0)
        k++;
    }
    printf("%d\n",k%2);
    }
}
    

 

2053——switch game

标签:style   blog   http   io   color   ar   for   sp   div   

原文地址:http://www.cnblogs.com/Yvettey-me/p/4076044.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!