#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
long long n,m;
double t1,t2;
string a,b;
int sti(string x) {
int kk,l=x.size();
for (int i=0; i<l; i++) {
kk=kk*1000+int(x[i]);
}
return kk;
}
void out(string x,int speed) {
for (int i=0; i<x.size(); i++) {
cout <<x[i];
Sleep(speed);
}
}
void cls() {
system ("cls");
}
void xy(int y,int x) {
COORD coord;
coord.X=x;
coord.Y=y;
HANDLE a=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(a,coord);
}
int main() {
printf ("请输入男方的拼音首字母:");
cin >>a;
printf ("\n请输入女方的拼音首字母:");
cin >>b;
n=sti(a); m=sti(b);
t1=(1314-(n*m)%1314)/1314.0;
t2=(520-(n+m*2)%520)/520.0;
cls();
xy(5,30);
printf ("正在计算中");
out ("...... ......",200);
xy(5,40);
out (" ",200);
cls();
xy(3,10);
out("他和她的相爱程度为:",50);
printf ("%.1lf \%",t2*100);
xy(5,10);
out("他和她的长久程度为:",50);
printf ("%.llf \%",t1*100) ;
xy(7,10);
out("他和她的匹配程度为:",50);
printf ("%.1lf \%",(t1+t2)/2*100);
return 0;
}