标签:turn struct hog long scan cout amp main war
不开long long见祖宗。
struct Node
{
LL galleon,sickle,knut;
}a,b;
int main()
{
scanf("%d.%d.%d",&a.galleon,&a.sickle,&a.knut);
scanf("%d.%d.%d",&b.galleon,&b.sickle,&b.knut);
LL sa=a.galleon*17*29+a.sickle*29+a.knut;
LL sb=b.galleon*17*29+b.sickle*29+b.knut;
LL res=sa+sb;
cout<<res/17/29<<‘.‘<<res%(17*29)/29<<‘.‘<<res%(17*29)%29<<endl;
//system("pause");
return 0;
}
晴神的写法:
int a[3],b[3],c[3];
int main()
{
scanf("%d.%d.%d",&a[0],&a[1],&a[2]);
scanf("%d.%d.%d",&b[0],&b[1],&b[2]);
int t=0;
c[2]=(a[2]+b[2])%29;
t=(a[2]+b[2])/29;
c[1]=(a[1]+b[1]+t)%17;
t=(a[1]+b[1]+t)/17;
c[0]=a[0]+b[0]+t;
cout<<c[0]<<‘.‘<<c[1]<<‘.‘<<c[2]<<endl;
//system("pause");
return 0;
}
标签:turn struct hog long scan cout amp main war
原文地址:https://www.cnblogs.com/fxh0707/p/14399826.html