Пример #1
0
int main() {
	printRuler();

	while ( (c = getchar()) != EOF) {
		if (c == '\n') {
			blankSpaces = 0;
			tabSpaces = 0;
			isCharReplaceQueued = 1;
			charUntilTabstop = TABSTOP_LENGTH;
			input[i] = c;
			i++;
		}
		else if (c != ' ') {
			if(isCharReplaceQueued == 0) {
				isCharReplaceQueued = 1;	
				layDownSpaces();
			}
			updateTabstop();
			input[i] = c;
			i++;
		}
		else {
			isCharReplaceQueued = 0;
			incrementSpacer();
		}
	}

	if(isCharReplaceQueued == 0) {
		isCharReplaceQueued = 1;	
		layDownSpaces();
	}
	
	printf("\n%s\n", input);
	return 0;
}
Пример #2
0
void ScreenData::printStyleInformation() const
{
    auto it = m_screen_blocks.end();
    std::advance(it, -m_block_count);
    for (int i = 0; it != m_screen_blocks.end(); ++it, i++) {
        if (i % 5 == 0) {
            QDebug debug = qDebug();
            debug << "Ruler:";
            printRuler(debug);
        }
        QDebug debug = qDebug();
        (*it)->printStyleList(debug);
    }
    qDebug() << "On screen height" << m_height;
}