POJ 2105 IP Address
来源:互联网 发布:ubuntu安装postgresql 编辑:程序博客网 时间:2024/05/16 17:13
大水题。分四段,二进制转十进制即可。
#include <iostream>#include <cstdio>#include <cstring>using namespace std;char a[32];int main(){int t;scanf("%d", &t);while (t--){scanf("%s", a);for (int i = 0; i < 4; i++){int ans = 0, weight = 1;for (int j = (i + 1) * 8 - 1; j >= i * 8; j--){ans += weight * (a[j] - '0');weight *= 2;}printf("%d", ans);if (i != 3)printf(".");}printf("\n");}}
0 0
- POJ 2105 IP Address
- poj 2105 IP Address
- poj 2105 IP Address
- POJ 2105 IP Address
- [2105]IP Address (POJ)
- IP Address(POJ--2105
- IP Address POJ 2105
- poj 2105 IP Address
- POJ 2105 IP Address
- POJ 2105 IP Address
- POJ 2105 IP Address
- poj-2105-IP Address
- poj 2105 IP Address(水题)
- OpenJudge/Poj 2105 IP Address
- POJ 2105 IP Address G++
- poj 2105 IP Address【模板 power2】
- POJ 2105 IP Address(水题)
- POJ 2105 IP Address(水~)
- Mysql安装笔记
- Mysql #1406 Data too long 错误
- Android 百分比布局库(percent-support-lib) 解析与扩展
- POJ 2136 Vertical Histogram
- github/gitlab 管理多个ssh key
- POJ 2105 IP Address
- clear cin buffer
- POJ 2139 Six Degrees of Cowvin Bacon
- Intellij Idea中运行tomcat 后报内存溢出
- Convert C# to VB.NET
- Xcode选择性编译
- Maven入门
- mathematica animate命令的使用与泰勒展开和插值
- Node js报错 npm ERR! cb() never called! Win7下安装NPM