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;
^
Enviar mensagem ao usuário trabalhando com as opções do php.ini
Meu Fork do Plugin de Integração do CVS para o KDevelop
Compartilhando a tela do Computador no Celular via Deskreen
Como Configurar um Túnel SSH Reverso para Acessar Sua Máquina Local a Partir de uma Máquina Remota
Configuração para desligamento automatizado de Computadores em um Ambiente Comercial
Criando uma VPC na AWS via CLI
Multifuncional HP imprime mas não digitaliza
Dica básica para escrever um Artigo.
Como Exibir Imagens Aleatórias no Neofetch para Personalizar seu Terminal
Melhorando a precisão de valores flutuantes em python[AJUDA] (11)
GLPI - Configuração de destinatário com conta Microsoft Exchange (0)
Vou voltar moderar conteúdos de Dicas e Artigos (3)
OpenVPN no MACBOOK conecta mas não pinga pastas de rede compartilhada ... (1)