FreeBSD:
iconv -f cp1251 -t utf-8 inputLinux:
iconv -fcp1251 -tutf-8 input
iconv -f cp1251 -t utf-8 inputLinux:
iconv -fcp1251 -tutf-8 input
Иногда может потребоваться указать протокол: -ssl2 или -ssl3# port 25/TLS; use same syntax for port 587 openssl s_client -connect remote.host:25 -starttls smtp # port 465/SSL openssl s_client -connect remote.host:465
# imaps: IMAP over SSL openssl s_client -connect remote.host:993 # pop3s: POP-3 over SSL openssl s_client -connect remote.host:995
string getElement(istringstream* strStream) {А потом полученную строку пытаемся загнать в переменную.
char ch;
string* input = new string;
input->assign("");
// Пропуск пробелов
do {
strStream->read(&ch, 1);
} while (ch == ' ');
// Считывание минуса, если он есть
if (ch == '-') {
input->append(1, ch);
strStream->read(&ch, 1);
}
// Поэлементное считывание числа
do {
if ((ch >= '0') && (ch <= '9')) {
if (strStream->good()) {
input->append(1, ch);
strStream->read(&ch, 1);
} else
break;
} else if (!strStream->good() || (ch == ' ') || (ch == '\n') || (ch == '\0'))
break;
else {
return "error";
}
} while (1);
return *input;
}
testString->assign("");
getline(inputfile, *testString);
testStream = new istringstream(*testString);
element = new istringstream(getElement(testStream));
delete testStream;
if ((*element >> s) && (s > 0) && (s <= 127)) {
outputfile << s << endl;
delete element;
}
class TwoDimenArray {
private:
short int array[ss][cc];
short int s;
short int c;
short int max;
short int maxs;
short int maxc;
bool errFlag;
public:
TwoDimenArray();
~TwoDimenArray();
void SearchMaxEl();
void CreateArray();
short int GetMax();
short int GetMaxStr();
short int GetMaxCol();
void PrintArray();
bool ErrTest();
};
void TwoDimenArray::CreateArray(int mode) {
istringstream* element;
istringstream* testStream;
//что-то будет...
}
short int TwoDimenArray::GetMax() {
return this->max;
}
short int TwoDimenArray::GetMaxStr() {
return this->maxs;
}
short int TwoDimenArray::GetMaxCol() {
return this->maxc;
}
void TwoDimenArray::SearchMaxEl() {
this->max = this->array[0][0];
for (int i = 0; i < this->s; ++i)
for (int j = 0; j < this->c; ++j)
if (this->max < this->array[i][j]) {
this->max = this->array[i][j];
this->maxs = i;
this->maxc = j;
}
}
void TwoDimenArray::PrintArray() {
outputfile << "Введённый массив:" << endl;
for (int i = 0; i < s; ++i) {
outputfile << "Строка " << i + 1 << ": ";
for (int j = 0; j < c; ++j)
outputfile << this->array[i][j] << " ";
outputfile << endl;
}
}
bool TwoDimenArray::ErrTest() {
return errFlag;
}
TwoDimenArray::TwoDimenArray() {
};
TwoDimenArray::~TwoDimenArray() {
};