/* Encrypted coordinates: 43,37,46,63,10,44,22,25,97,52,97,74,36,10 */
int encrypted [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x};
int key [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x};
int key2 [14] = {2,9,5,7,6,1,8,3,2,7,3,7,4,2};
int divisor;
int subtrahend;
int coordinates [14];
for (i = 0; i < 14; i ) {
divisor = key2[ i] key[13 - i];
subtrahend = key[ i] key2[9];
coordinates[ i]= (encrypted[ i]- subtrahend)/divisor; }
/* code syntax:
array indexes started 0.
int mean integer.
for-loop: for(start situation; must be true; repeat every round) */
Kyseisestä C-ohjelmointikoodista pitäisi tulostua tietyt luvut, mutta mitkä? Itselleni kyseinen koodi on täyttä hepreaa, joten jos joku täällä osaisi suomentaa tämän...?
int encrypted [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x};
int key [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x};
int key2 [14] = {2,9,5,7,6,1,8,3,2,7,3,7,4,2};
int divisor;
int subtrahend;
int coordinates [14];
for (i = 0; i < 14; i ) {
divisor = key2[ i] key[13 - i];
subtrahend = key[ i] key2[9];
coordinates[ i]= (encrypted[ i]- subtrahend)/divisor; }
/* code syntax:
array indexes started 0.
int mean integer.
for-loop: for(start situation; must be true; repeat every round) */
Kyseisestä C-ohjelmointikoodista pitäisi tulostua tietyt luvut, mutta mitkä? Itselleni kyseinen koodi on täyttä hepreaa, joten jos joku täällä osaisi suomentaa tämän...?
Vastaukset 3
Vanhimmat
Ei tuo koodi tulosta yhtään mitään. Kotitehtävät sitä paitsi pitäisi tehdä ihan itse.
Tuleeko nämä mihin?
/* Encrypted coordinates: 43,37,46,63,10,44,22,25,97,52,97,74,36,10 */
int encrypted [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x}; // onko x int vai char?
int key [14] = {x,x,x,x,x,x,x,x,x,x,x,x,x,x}; // onko x int vai char?
Jos nyt hiukan puretaan pakettia....
Luvut 43,37,46,63,10,44,22,25,97,52,97,74,36,10 ei mahdu ku koodin kolmeen elementtiin.
Loopin eka kierros:
----------------------------------------------------------
divisor = key2[ 0] key[13];
subtrahend = key[ 0] key2[9];
coordinates [0]= (encrypted[ 0]- subtrahend)/divisor;
JOS: int key [14] = { 43,37,46,63,10,44,22,25,97,52,97,74,36,10 }
----------------------------------------------------------
12 = 2 10
50 = 43 7
? = (? - 50) / 12
JOS: int coordinates [14] = { 43,37,46,63,10,44,22,25,97,52,97,74,36,10 }
----------------------------------------------------------
divisor = 2 ?
subtrahend = ? 7;
43 = (? - subtrahend) / divisor
JOS: int encrypted [14] = { 43,37,46,63,10,44,22,25,97,52,97,74,36,10 }
----------------------------------------------------------
divisor = 2 ?
subtrahend = ? 7;
? = (43 - subtrahend) / divisor
Jos tällä purkamisella apua niin hyvä mutta mistä tämä tehtävä on ? Mielenkiinnosta haluaisin nähdä tehtävän kokonaisuudessaan.