#include <iostream>
#include <string>
using namespace std;
void main()
{
string input, input2;
string sio[] = {"tikus", "kerbau", "macan", "kelinci", "naga", "ular", "kuda", "kambing", "monyet", "ayam", "anjing", "babi"};
int x, sio1, sio2;
cout<<"Masukan Sio Pertama : "; cin>>input;
cout<<"Masukan SIo Kedua : "; cin>>input2;
for ( x = 0; x < 12; x++ )
{
if ( input == sio[x] )
{
sio1 = x;
}
if ( input2 == sio[x] )
{
sio2 = x;
}
}
cout<<sio1<<endl;
cout<<sio2<<endl;
if ( abs (sio1-sio2) == 4 || abs (sio1-sio2) == 8 )
{
cout<<"Berjodoh";
}
else{
cout<<"Tidak Berjodoh"; }
}
No comments:
Post a Comment