A
来源:互联网 发布:长沙编程招聘信息 编辑:程序博客网 时间:2024/05/16 01:30
Think:
1知识点:“进制转换”
2思考:
初始计数位权
int blue[] = {0, 1, 2, 4, 5, 6, 7, 9};
回溯位权
int red[] = {0, 1, 2, 0, 3, 4, 5, 6, 0, 7};
vjudge题目链接
以下为Accepted代码
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;int red[] = {0, 1, 2, 0, 3, 4, 5, 6, 0, 7};int main(){ int u, x, i, tp, link[14]; while(scanf("%d", &x) && x){ tp = 0; u = x; while(x){ link[tp++] = x%10; x /= 10; } int sum = 0, p = 1; for(i = 0; i < tp; i++){ sum += red[link[i]]*p; p *= 8; } printf("%d: %d\n", u, sum); } return 0;}
阅读全文
1 0
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- A
- A*
- a
- A
- a
- HDU 6040 2017多校第一场
- 端口分类
- hdu4513 (manacher)
- PKU-2769-Reduced ID Numbers
- AWSS3技术点分析
- A
- LeetCode -- 88. Merge Sorted Array
- bzoj1943: [Ceoi2007]Nasty Calculations
- HDU
- hdu 1213 How Many Tables 并查集
- 安装react并创建一个demo
- 进行docker 安装并搭建tensorflow 框架用于以后tensorflow 测试学习
- Struts2学习笔记一
- string详解