找规律
class Solution {
public:
char word[1000];
string convert(string s, int numRows) {
int cnt = 0, n = s.length();
int step = max(2*numRows-2,1);
for(int i = 0;i < numRows; i++){
int shift = 2*numRows-2-2*i;
for(int j = i;j < n; j+=step){
word[cnt++] = s[j];
if(i != 0 && i != numRows-1){
if(j+shift < n)
word[cnt++] = s[j+shift];
}
}
}
word[cnt]='\0';
return word;
}
};