ZOJ Problem Set - 3713
set Problem zoj
2023-09-14 08:57:54 时间
题意:给定一个字符串,用字符串ASC2码16进制数输出 ,并在前面输出字符串长度的16进制,输出长度的规则是 先输出长度的二进制数的后七位的十六进制(如果左边还有1 则这在后七位前面加上个1再输出 然后二进制数右移动七位,直到左边没有1) 注:所有16数都必须为两位!
解题思路:对长度进行输出处理
解题代码:
#include stdio.h #include string.h #include stdlib.h #include time.h #include math.h char str[3000005]; int bi[100]; void print(int x) if (x 10) printf("0%d",x); else if(x 16) printf("0%c",A+(x-10)); else if(x /16 10) printf("%d",x/16); else if(x/16 16) printf("%c",A+(x/16-10)); if(x%16 10) printf("%d",x%16); else printf("%c",A+(x%16-10)); int main(){ //freopen("/home/plac/problem/input.txt","r",stdin); //freopen("/home/plac/problem/output.txt","w",stdout); int t; scanf("%d", getchar(); while(t--) gets(str); int k = strlen(str); int b = 2097152,c = 16384 , d= 128; // scanf("%d", if(k = b) print(k%d+d); print(k%c/d+d); print(k%b/c+d); print(k/b); else if(k = c) print(k%d+d); print(k%c/d+d); print(k/c); else if(k = d) print(k%d +d); print(k/d); else print(k); for(int i = 0 ;i i ++) if(str[i] 16) print(str[i]); else print(str[i]); printf("\n");
二哥聊RPA 公号「二哥聊RPA」。关注我,一起洞察 RPA ◎ RPA创业者 ◎ 现明堂红木商业顾问,为十月结晶、可啦啦、鑫蜂维等多家企业提供 RPA 咨询服务 ◎ 希望帮助大家在 RPA 上做一些力所能及的事情
相关文章
- java set 排序的_Set集合排序
- redis设置过期时间后再set还用设置时间吗_java中参数传递的两种方式
- unordered_map/unordered_set/unorder_multiset/unorder_multimap-C++容器
- ZOJ Problem Set - 1002
- ZOJ Problem Set - 1015
- incremental out directory should be set to aar output directory
- ORA-30001: trim set should have only one character ORACLE 报错 故障修复 远程处理
- ORA-30370: set operators are not supported in this context ORACLE 报错 故障修复 远程处理
- ORA-38443: An attribute set should be assigned to the expression set for statistics collection. ORACLE 报错 故障修复 远程处理
- MySQL Error number: MY-011309; Symbol: ER_XPLUGIN_FAILED_TO_SET_MIN_NUMBER_OF_WORKERS; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-07682: sou2os: set kernel dispatch fail err ORACLE 报错 故障修复 远程处理
- java遍历Set集合详解编程语言
- Oracle 视图 DBA_RULE_SET_RULES 官方解释,作用,如何使用详细说明
- 实现MySQL函数SET实现灵活应用(mysql函数set)
- python-set详解编程语言
- 红色随机Redis 的Set类型(set 随机 redis)
- Redis中Set集合操作实战技巧(redis集合set操作)
- 数据Redis实现Set数据随机取值(redis随机取set)
- Oracle中SET的威力轻松实现赋值(oracle中set赋值)
- Oracle中SET用法洞悉调整工作环境(oracle中set用法)
- 发现奥秘Redis遍历Set集合(redis遍历set集合)
- Redis实现Set元素查询功能(redis返回set元素)
- Redis实现快速获取Set数据列表(redis获取set列表)
- Redis中Set个数查询实战指南(redis查询set个数)