一些test短代码

#include <stdio.h>

int main(){
char ray_tx_pwr[2][3]={{1,2,3},{4,5,6}};
int i = 0;
printf("r %d",ray_tx_pwr[0]);
return 0;
}

 

#include <stdio.h>
#define USAGE 0XFF00

int main(){
printf("USAGE %x", USAGE + 1);

return 0;
}

#include "stdio.h"
#include "string.h"
#include "string"
#include "iostream"
#include "math.h"
#include "map"

using namespace std;

map<char,string> mp;
map<char,string>::iterator it;
int main(int argc, char const *argv[])
{
mp['0']="0000";mp['1']="0001";mp['2']="0010";
mp['3']="0011";mp['4']="0100";mp['5']="0101";
mp['6']="0110";mp['7']="0111";mp['8']="1000";
mp['9']="1001";mp['A']="1010";mp['B']="1011";
mp['C']="1100";mp['D']="1101";mp['E']="1110";
mp['F']="1111";


for(it = mp.begin(); it != mp.end(); it++)
cout<<it->first<<":"<<it->second<<endl;
return 0;
}

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char sentence[]="This is a sentence with 7 tokens";
cout << "The string to be tokenized is:\n" << sentence << "\n\nThe tokens are:\n\n";
char *tokenPtr=strtok(sentence," ");
while(tokenPtr!=NULL){
cout<<tokenPtr<<endl;
tokenPtr=strtok(NULL," ");
}
//cout << "After strtok,sentence=" << tokenPtr<<endl;
return 0;
}
~

posted on   dingyun  阅读(74)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示