Skip to content

Commit

Permalink
impressão melhorada
Browse files Browse the repository at this point in the history
  • Loading branch information
GuScarenci committed Oct 29, 2022
1 parent e8d2cfc commit 241d0b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lista06/ex05/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@

int main(int argc, char** argv) {

srand (time(NULL));
srand(time(NULL));

int n;
std::cin >> n;

std::vector<NumComplexo> meuVetor;

std::cout << "Sorteando " << n << " números complexos..." << std::endl;

for(int i = 0; i < n;i++){
meuVetor.push_back(NumComplexo(rand()%100,rand()%100));
NumComplexo randComplexo(rand()%100,rand()%100);
meuVetor.push_back(randComplexo);
std::cout << randComplexo << std::endl;
}

NumComplexo *somaComplexo = new NumComplexo(0,0);
Expand All @@ -34,7 +38,7 @@ int main(int argc, char** argv) {
*somaComplexo = *somaComplexo + elemento;
}*/

std::cout << *somaComplexo << std::endl;
std::cout << "Soma dos números complexos sorteados:" <<*somaComplexo << std::endl;
delete(somaComplexo);//Livra a memória deletando todos os objetos utilizados no programa.

return 0;
Expand Down
2 changes: 2 additions & 0 deletions lista06/ex05/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/gustavoscarenci/USP/4Semestre/POO/SCC0604-POO-2022.2/lista06/ex05/numeros_complexos.hpp</file>
<file>file:/home/gustavoscarenci/USP/4Semestre/POO/SCC0604-POO-2022.2/lista06/ex05/numeros_complexos.cpp</file>
<file>file:/home/gustavoscarenci/USP/4Semestre/POO/SCC0604-POO-2022.2/lista06/ex05/main.cpp</file>
</group>
</open-files>
Expand Down

0 comments on commit 241d0b4

Please sign in to comment.