victorialais

culpado, cúmplice ou inocente

May 27th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale.h>
  3. #include <string>
  4. using namespace std;
  5. int main(){
  6.     string p1, p2,p3,p4,p5;
  7.     int contador;
  8.      setlocale(LC_ALL, "Portuguese");
  9.     contador = 0;
  10.     cout<<"Responda S para sim e N para não"<<endl;
  11.     cout<<"Telefonou para a vítima?"<<endl;
  12.     cin>>p1;
  13.     cout<<"Esteve no local do crime?"<<endl;
  14.     cin>>p2;
  15.     cout<<"Mora perto da vítima?"<<endl;
  16.     cin>>p3;
  17.     cout<<"Devia para a vítima?"<<endl;
  18.     cin>>p4;
  19.     cout<<"Já trabalhou com a vítima?"<<endl;
  20.     cin>>p5;
  21.    
  22.             if(p1 == "S"|| p1 == "s"){
  23.             contador++;
  24.         }
  25.             if(p2 == "S"|| p2 == "s"){
  26.             contador++;
  27.         }
  28.             if(p3 == "S"|| p3 == "s"){
  29.             contador++;
  30.         }
  31.             if(p4 == "S"|| p4 == "s"){
  32.             contador++;
  33.         }
  34.             if(p5 == "S"|| p5 == "s"){
  35.             contador++;
  36.         }
  37.                 if(contador < 2){
  38.                 cout<<"Inocente!"<<endl;
  39.                 }
  40.                 if(contador == 2){
  41.                 cout<<"Suspeito!"<<endl;
  42.                 }
  43.                 if(contador > 2 && contador < 5){
  44.                 cout<<"Cúmplice!"<<endl;
  45.                 }
  46.                 if(contador == 5){
  47.                 cout<<"Culpado!"<<endl;
  48.                 }
  49.     system("pause");
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment