
小操作的优化
icankeep
优雅程序猿
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
用位(与和或)操作实现字母大小写转换
//小写转大写#include <iostream>using namespace std;int main(){ char a = 'c'; char b = a&(0b11011111); cout<<b<<endl;} //大写转小写#include <iostream>using namespace std;...原创 2019-01-12 19:48:38 · 628 阅读 · 0 评论 -
或操作实现数字转ASCII
#include <iostream>using namespace std; int main(){ int a = 5; int b = 5 | 48; cout<<b<<endl;}原创 2019-01-12 19:54:42 · 836 阅读 · 0 评论