/* filename : wa.c */#include<stdio.h>/* test shift left << function */voidtest_shift_left(void){char x =1;for(int i =0; i <9; i++){char c = x << i;printf("No.%d, [%3d]\n", i, c);}}/**/intmain(int argc,char*argv[]){test_shift_left();return0;}//----- << -----//
/* filename : wa.c */#include<stdio.h>/* test shift left << function */voidtest_shift_left(void){char x =1;char n =0x74;//#b0111 0100for(int i =0; i <9; i++){unsignedchar c = x << i;char r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);}}/**/intmain(int argc,char*argv[]){test_shift_left();return0;}//----- << -----//
/* filename : wa.c */#include<stdio.h>/* test shift left << function */voidtest_shift_left(void){char buf[9]={0};char x =1;char n =0x74;//#b0111 0100for(int i =0, j =7; i <8; i++, j--){unsignedchar c = x << i;char r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);if(r !=0) buf[j]='1';else buf[j]='0';}printf("-------------------------\n");printf("0x%X ===> [%s]\n", n, buf);}/**/intmain(int argc,char*argv[]){test_shift_left();return0;}//----- << -----//
/* test shift right >> function */voidtest_shift_right(void){unsignedchar x =0x80;//#b1000 0000char n =0x44;//#b0100 0100for(int i =0; i <8; i++){unsignedchar c = x >> i;unsignedchar r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);}}/**/intmain(int argc,char*argv[]){//test_shift_left ();test_shift_right();return0;}//----- << & >> -----//
/* test shift right >> function */voidtest_shift_right(void){char buf[9]={0};unsignedchar x =0x80;//#b1000 0000//char n = 0x44; //#b0100 0100unsignedchar n =0xF4;//#b1111 0100for(int i =0; i <8; i++){unsignedchar c = x >> i;unsignedchar r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);if(r !=0) buf[i]='1';else buf[i]='0';}printf("-------------------------\n");printf("0x%X ===> [%s]\n", n, buf);}
/* filename : wa.c */#include<stdio.h>/* test shift left << function */voidtest_shift_left(void){char buf[9]={0};char x =1;char n =0x74;//#b0111 0100for(int i =0, j =7; i <8; i++, j--){unsignedchar c = x << i;char r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);if(r !=0) buf[j]='1';else buf[j]='0';}printf("-------------------------\n");printf("0x%X ===> [%s]\n", n, buf);}/* test shift right >> function */voidtest_shift_right(void){char buf[9]={0};unsignedchar x =0x80;//#b1000 0000//char n = 0x44; //#b0100 0100unsignedchar n =0xF4;//#b1111 0100for(int i =0; i <8; i++){unsignedchar c = x >> i;unsignedchar r = n & c;printf("No.%d, [%3d], [%d]\n", i, c, r);if(r !=0) buf[i]='1';else buf[i]='0';}printf("-------------------------\n");printf("0x%X ===> [%s]\n", n, buf);}/**/intmain(int argc,char*argv[]){//test_shift_left ();test_shift_right();return0;}//----- << & >> -----//
springdoc-openapi Java 库有助于使用 Spring Boot 项目自动生成 API 文档。springdoc-openapi 通过在运行时检查应用程序来根据 Spring 配置、类结构和各种注释推断 API 语义。 该库会自动生成 JSON/YAML 和 HTML 格式的页面文档。生成的文档可以使用swagger-api注释进行补充。…