Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <locale.h>
- using namespace std;
- int main (){
- char s,c;
- string n;
- int i,m=0,f=0,maiorm=0,menorm=0,maiorf=0,menorf=0;
- cout<<"Deseja cadastrar o cliente? sim (s) ou nao (n)"<<endl;
- cin>>c;
- do {
- cout<<"Informe o sexo do cliente feminino(f) ou masculino (m)"<<endl;
- cin>>s;
- switch (s){
- case 'm':
- m++;
- cout<<"Informe a idade do cliente"<<endl;
- cin>>i;
- if (i>=18)
- maiorm++;
- else
- menorm++;
- cout<<"Informe o nome"<<endl;
- cin>>n;
- break;
- case 'f':
- f++;
- cout<<"Informe a idade do cliente"<<endl;
- cin>>i;
- if (i>=18)
- maiorf++;
- else
- menorf++;
- cout<<"Informe o nome"<<endl;
- cin>>n;
- break;
- }
- } while (c==s);
- cout<<m<<" homens"<<endl;
- cout<<f<<" mulheres"<<endl;
- cout<<maiorm<<" homens maiores de 18 anos"<<endl;
- cout<<menorm<<" homens menores de 18 anos"<<endl;
- cout<<maiorf<<" mulheres maiores de 18 anos"<<endl;
- cout<<menorm<<" mulheres maiores de 18 anos"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement