哈理工oj 1946 你猜
来源:互联网 发布:linux qt usb 编辑:程序博客网 时间:2024/05/21 19:41
给一段序列010010100110100101100001011011110111101001101000011101010011100000110111,你猜猜它是什么?
无
ASCII码一共有256个元素
Source新生练习赛(2013.11.17)Authorhrbust写这个不为别的,只是为了提醒自己不要忘了基础知识。
附上ASCII表:
ASCII控制字符
ASCII可显示字符
直接上代码:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <stack>
#define mem(a, b) memset(a, b, sizeof(a))
using namespace std;
typedef long long LL;
///o(っ。Д。)っ AC万岁!!!!!!!!!!!!!!
const int maxn = 1030, inf = -1999999999;
int str[maxn] = {}, book[maxn] = {};
int main()
{
string str = "010010100110100101100001011011110111101001101000011101010011100000110111";
stack<char>stacks;
int cnt = 71;
while(cnt > 0)
{
int ten = 1, sum = 0;
for(int i = 1; i <= 8; i++)
{
if(str[cnt] == '1')
sum += ten;
cnt--;
ten *= 2;
}
stacks.push(sum);
}
while(!stacks.empty())
{
printf("%c", stacks.top());
stacks.pop();
}
puts("");
}
/*
*/
- 哈理工oj 1946 你猜
- 哈理工OJ 2179(深搜)
- 哈理工 oj 1161 Leyni
- 哈理工OJ 1692【水题】
- 哈理工oj 2317 Game
- 哈理工oj 2002 幂集
- 哈理工 oj 2189 节点的连接
- HLG 哈理工OJ 2074逃生
- 哈理工OJ 1926 函数式计算
- 哈理工OJ 2090 背包【思维】
- 哈理工OJ 2171 做菜【思维】
- 哈理工OJ 1431 摞盘子【水题】
- hrbust 哈理工oj 1588 神医【贪心】
- hrbust 哈理工oj 网线【MST+Prim】
- 哈理工oj 2035 Diablo【BFS+DFS】
- 哈理工oj/hrbust 1790 武林【DP】
- 哈理工OJ 1289 对数问题
- hrbust哈理工oj 1674 充电【贪心】
- python常用函数库(一)
- QueryList 4.0 简洁、优雅、可扩展的PHP采集工具(爬虫)
- 七种常见排序算法及实现
- python笔记
- jdbc之数据库连接池
- 哈理工oj 1946 你猜
- 机器学习数学基础--牛顿法
- 542. 01 Matrix -- Medium
- tensorflow实战之二:MNIST手写数字识别的优化1-代价函数优化
- 92. Reverse Linked List II
- JavaScript高级
- Codeforces869E The Untended Antiquity
- 为什么我博客里的插图都不见了???!!!
- java学习第24天(续),学习几个API,indexOf(),charAt(),toUpperCase(),toLowerCase(),subString(),trim()