Lowest Bit
Lowest Bit
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 34 Accepted Submission(s) : 17
#include <stdio.h>
#include <stdlib.h>
#include <string.h> int main()
{
int num,sign,i,j,k,K,sum;
char num_2[],NUM_2[];
while()
{
scanf("%d",&num);
if(num==)break;
itoa(num,num_2,);
sign=strlen(num_2);
for(i=sign-,j=;i>=;i--)
{
if(num_2[i]!='')
{
NUM_2[j]='';
j++;
}
else
{
NUM_2[]='';
NUM_2[j]='\0';
break; }
}
k=strlen(NUM_2);
for(i=,sum=;i<k;i++)
{
sum*=;
}
printf("%d\n",sum); }
return ;
}
Lowest Bit的更多相关文章
- [LeetCode] Lowest Common Ancestor of a Binary Tree 二叉树的最小共同父节点
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- [LeetCode] Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的最小共同父节点
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- 48. 二叉树两结点的最低共同父结点(3种变种情况)[Get lowest common ancestor of binary tree]
[题目] 输入二叉树中的两个结点,输出这两个结点在数中最低的共同父结点. 二叉树的结点定义如下: C++ Code 123456 struct BinaryTreeNode { int ...
- [LeetCode]Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- 数据结构与算法(1)支线任务4——Lowest Common Ancestor of a Binary Tree
题目如下:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Given a binary tree, fin ...
- Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- leetcode 235. Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
- leetcode 236. Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...
- LeetCode 【235. Lowest Common Ancestor of a Binary Search Tree】
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS ...
随机推荐
- NS_ASSUME_NONNULL_BEGIN 延伸
NS_ASSUME_NONNULL_BEGIN和NS_ASSUME_NONNULL_END 在.h文件中,可以看到这两个宏,翻看定义,这两个宏的代码是 #define NS_ASSUME_NONNUL ...
- Collector
安装 参考安装文章 创建项目project 转到你创建的目录,运行命令 django-admin.py startproject collector 生成下列文件 collector/ __ini ...
- php灌水
<?php $data=array('name'=>'paul','mail'=>'paulversion@163.com') $data=http_build_query($dat ...
- 使用minidom来处理XML的示例(Python 学习)(转载)
作者网站:http://www.donews.net/limodou/archive/2004/07/15/43609.aspx 一.XML的读取.在 NewEdit 中有代码片段的功能,代码片段分 ...
- POJ 2977 Box walking
题目链接:http://poj.org/problem?id=2977 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 222 ...
- redis :初步使用
redis : 1.ubuntu安装 'pip install redis-server' 2.启动 'redis-cli' 3.使用 set: set a 1 get: get a fl ...
- 安装Python package
下载对应的源码,往往都是.tar.gz,.zip的压缩包,解压. 打开windows的cmd,切换到对应目录 C: cd C:\xx setup.py install
- 6、50道JAVA基础编程练习题跟答案
50道JAVA基础编程练习题 [程序1] 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 程序分析 ...
- OpenLayer
<html> <head> <meta charset="utf-8"> <title>GIS开发样例-V1.0</title ...
- 关于python的类方法、实例方法和静态方法区别
python的类方法需要在方法前面加装饰器:@classmethod ,静态方法是在方法前面加装饰器:@staticmethod. 类方法.类属性是属于类自身,属于类自身的命名空间,和实例方法.实例属 ...