All pastes #441176 Raw Edit

Someone

public c v1 · immutable
·published 2007-04-15 15:32 UTC
rendered paste body
int main(int argc, char* argv[]) {	int count;	int filearg;/////////// ZPRACOVANI PARAMETRU /////////////////////////////////////	if(argc == 1) {			count = 10;		filearg= 0;	}		// tail soubor nebo cteni ze stdin	else if(argc == 2) {		//tail soubor		count = atoi(argv[1]);		if(count == 0) {			count = 10;			filearg = 1;		}		//tail count		else {			count = atoi(argv[1]);			filearg = 0;		}	}		//tail count soubor	else if(argc == 3) {		filearg = 2;		count = atoi(argv[1]);	}	else {		fprintf(stderr,"Spatny pocet parametru!!");	}///////// VYPIS //////////////////////////////////////////	if(count < 0) {		if(filearg == 0) {			PrintMinus((count*-1),stdin);		}		else {			PrintMinus((count*-1),fajlopen(argv[filearg]));		}	}	else if(count == 0) {		fprintf(stderr,"Spatne zadany pocet radku");		}	else if(count > 0) {		if(filearg == 0) {			PrintPlus(count,stdin);		}		else {			PrintPlus(count,fajlopen(argv[filearg]));		}	}	else {		fprintf(stderr,"Neznama chyba :)");	}	return 0;}