Enviado em 24/02/2019 - 11:18h
cabeçalho fornecidovoid lister(double a, double b, int n)
#include <iostream>
#include <cmath>
#include <iomanip>
void listar(double a, double b, int n)
using namespace std;
int main (int argc, char *argv[]){
cout << "Programa para exibir os n primeiros multiplos de a não superiores a b\n";
double a, b;
cout << "a = "; cin >> a;
cout << "b = "; cin >> b;
double n = a;
listar(n);
return 0;
}
void listar(double a, double b, int n){
while (n <= b)
{
cout << n << endl;
n = n + a;
}
return n;
}
[humbra@x550l livro]$ g++ Exercicio12004.cpp -o exp12004
Exercicio12004.cpp:7:1: error: expected initializer before ‘using’
using namespace std;
^~~~~
Exercicio12004.cpp: In function ‘int main(int, char**)’:
Exercicio12004.cpp:10:3: error: ‘cout’ was not declared in this scope
cout << "Programa para exibir os n primeiros multiplos de a não superiores a b\n";
^~~~
Exercicio12004.cpp:10:3: note: suggested alternative:
In file included from Exercicio12004.cpp:1:
/usr/include/c++/8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^~~~
Exercicio12004.cpp:13:19: error: ‘cin’ was not declared in this scope
cout << "a = "; cin >> a;
^~~
Exercicio12004.cpp:13:19: note: suggested alternative:
In file included from Exercicio12004.cpp:1:
/usr/include/c++/8/iostream:60:18: note: ‘std::cin’
extern istream cin; /// Linked to standard input
^~~
Exercicio12004.cpp:16:3: error: ‘listar’ was not declared in this scope
listar(n);
^~~~~~
Exercicio12004.cpp: In function ‘void listar(double, double, int)’:
Exercicio12004.cpp:26:4: error: ‘cout’ was not declared in this scope
cout << n << endl;
^~~~
Exercicio12004.cpp:26:4: note: suggested alternative:
In file included from Exercicio12004.cpp:1:
/usr/include/c++/8/iostream:61:18: note: ‘std::cout’
extern ostream cout; /// Linked to standard output
^~~~
Exercicio12004.cpp:26:17: error: ‘endl’ was not declared in this scope
cout << n << endl;
^~~~
Exercicio12004.cpp:26:17: note: suggested alternative:
In file included from /usr/include/c++/8/iostream:39,
from Exercicio12004.cpp:1:
/usr/include/c++/8/ostream:590:5: note: ‘std::endl’
endl(basic_ostream<_CharT, _Traits>& __os)
^~~~
Exercicio12004.cpp:29:10: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
return n;
^
DOOM clássico (quase) vanilla e um pouco melhorado
Mamãe, quero descompactar e também compactar arquivos no terminal!
Um ótimo codec e sua configuração para KDEnLive
Atualizar Mint para versão 22 BETA
Nao e possivel acessar esse site (3)
Pendrive sem se desmontar [RESOLVIDO] (8)
estou usando o ubuntu mate 22.04 preciso atualiza lo? (6)