search points attachment profile arrow left arrow right star heart verified symbols equation arrow-down question mark check menu accountancyadministrationagriculturalalgebraallarabicartart_musicbelarusbelarus_altbiologybusinesscatalachemistrychineseeconomicsegzamenglishentrepreneurshipenvironmentethicseuskarafirst_aidfrenchgalegogeographygeologygeometrygermangrammarhealthhistoryindia_langindonesian_langinformaticsitalianjapanesekazachkazach_altkoreanlanguagelatinlawlife_scienceliteraturelogicmathematicsmusicnigerian_langother_languagesotherspedagogicsphilosophyphysical_educationphysicspoliticspsychologyreligionrpa_langrussianrussian_altsciencesecurityskillssocial_sciencesociologyspanishstatisticstechnologytourismtrafficukrainianukrainian_altukrainian_literaturewos_civilisation accountancyadministrationagriculturalalgebraall_1arabicartart_music_2belarusbelarus_altbiologybusiness_2catalachemistry_1chineseeconomicsexam_3englishentrepreneurshipenvironment_2ethicseuskarasecurity_1frenchgalegogeography_4geology_4geometrygermangrammarhealthhistoryindia-langindonesian-langinformaticsitalianjapanesekazachAsset 230koreanlanguagelatinlawlife-scienceliteraturelogic_2mathematicsmusicnigerian-langotherlanguagesother_1pedagogicsphilosophyphysical_educationphysicspoliticspsychologyreligion_1rpa-langrussianrussian_altsciencesecurity_3_mskills_1allsocial_science_5_msociologyspanishstatisticstechnologytourismtrafficukrainianukrainian_altukrainian_literaturewos_civilisation

Ответ

Ответ дан
voldemorovich

Ответ:

#include <cstdio>

#include <malloc.h>


int main(){

 

int CountOfElements;

int *Elements;  

 

scanf("%d",&CountOfElements); // Получение кол-ва элементов

Elements = (int*)malloc(CountOfElements * sizeof(int));

 

//заполнение массива

for(int i = 0; i < CountOfElements;i++){

 scanf("%d",&Elements[i]);

}

 

//Алгоритм получения суммы

for(int i = 0; i < CountOfElements;i++){

 printf("%s%d%s","Sum of ",i+1," elements - ");

 int Num = 0;

 for(int j = 0;j <= i;j++){

  Num = Num + Elements[j];  

 }

 printf("%d",Num);

 printf("%s","n");

}

 

return 0;

}

Объяснение:

Писал в Dev-C++ 5.11

Ответы и объяснения

Не тот ответ, который тебе нужен?


По всем вопросам пишите на - vashurokk@rambler.ru