bool palindrome(char* s){int left =0;int right =strlen(s)-1;while(left < right){if(s[left]!= s[right])return false;left++;right--;}return true;}
二.程序题
7-1 求矩阵每行元素的和
#defineN6intmain(){int m, n, sum =0;int a[N][N];int(*p)[N];int i, j;p = a;scanf("%d%d",&m,&n);for(i =0; i < m; i++){for(j =0; j < n; j++){scanf("%d",&*(*(p + i)+ j));}}for(i =0; i < m; i++){sum =0;for(j =0; j < n; j++){sum = sum +*(*(p + i)+ j);}printf("%d\n", sum);}return0;}