p1539.cpp
来自「高手写的所有acm例程 在acm.zju.edu.cn 上的题目的例程」· C++ 代码 · 共 21 行
CPP
21 行
// p1539.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
int N;
int f ( int n )
{
if ( n == 3 ) return 1;
if ( n < 3 ) return 0;
return ( n & 1 )? f ( n >> 1 ) + f ( ( n + 1 ) >> 1 ) : f ( n >> 1 ) << 1;
}
int main(int argc, char* argv[])
{
while ( scanf ( "%d" , &N ) != EOF )
printf ( "%d\n" , f ( N ));
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?