phoenix ([info]phoenix) wrote on May 3rd, 2006 at 05:46 pm
eeem, man vienalga neksaita pareizi. ciklaa visos gadiijumos no char_masivs[i] jaatnjem '0'?
summa = summa + char_masivs[i] - '0' ?
'0' vietaa nav kaukaada cita veertiiba atbilstoshi konkreetajam simbolam vai kaa?

Tiesa, skaitiit tagad vismaz skaita (pirms tam pat neskatiija un meta kljuudu), bet shkjiet, ka ieguutais int ir savaadaaks. Man kauko smejmoon teica par to, ka txt failaa charu nolasot savaadaak nekaa int un ai. putra.

vaardu sakot, faila rindinju 123 izpildot kodu sanaak -145, nevis 6. Un summu es saakumaa inicializeeju uz 0, kaa noraadiiji.
 
( Read comments )
Post a comment in response:
From:
( )Anonymous- this user has disabled anonymous posting.
Username:
Password:
Subject:
No HTML allowed in subject
  
Message:

Notice! This user has turned on the option that logs your IP address when posting.