摘要:
2的二进制:10 1的二进制:01 汉明距为不同值的总和数。为2 阅读全文
摘要:
1 //反转字符串及数字 2 3 #include 4 #include 5 using namespace std; 6 7 /*int reverseString(char *s) { 8 //int i=0,j=i+strlen(s)-1; 9 int len=strlen(s); 10 char *begin,*en... 阅读全文
摘要:
1 //找出矩阵中最大元素值,及所在位置 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 int i,j,row=0,col=0,max; 9 int a[3][4]={{1,2,3,4},{9,8,7,6},{-10,10,-5,2}}; 10 max=a[0][0... 阅读全文
摘要:
1 //统计单词数 2 #include 3 4 using namespace std; 5 6 int main() 7 { 8 char string[81]; 9 int i,num=0,word=0; 10 char c; 11 gets(string); 12 for(i=0;(c=string[i])!='\0';i+... 阅读全文