locy 0 Newbie Poster

How do i write a programm that the given text.the longer the text will factorized (in primenumber order).The text is for the following transformation as matrix with the Dimention n(breath;smaller Primefactor) multiply m(highest;bigger Primefactor).The letters of this matrix will in column by column displayed the output format is the transpose Matrix of Dimention m x n.


Es
w
ar
ein
mal
Es war einmal, vor langer Zeit.. , E a iml o agrZi.swrena,vrlne et.....
vo
r la
nge
r Z
eit
...

input.
these from the text in the standard input.the readfunction with longer text to EOF read.

factorise.
analyse the length of the text in two Prime number.check if the length in prime number or in
two factors yields(the factors is not by calculationt).
The length for 37.will from breath 17 and height 2 from the given Matrix.

example in:
http://de.wikipedia.org/wiki/Faktorisierungsverfahren

34 = 2 * 17
Output
The output of the text will in square from m column and n line out.
i.e Input
Es war einmal, vor langer Zeit...
the Output
Es war einmal, vor langer Zeit...
generate.
the text will "\n" closed.

Error report.
there most be the following error
Return -1 "ERROR: Input length is prime\n"
when the given length Texts is a Prime numbers
Return -2 "ERROR: Input length has too many prime factors\n"
when the given length Texts have more than 2 Prime faktors
Return -3 "ERROR: No input\n"
when a text of lenght 0 is given.
more Errors are possible to occure.
any of these can be uses
• stdio.h
• stdlib.h
• math.h