⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pku1914.cpp

📁 这是ACM 方面的资料 是PKU的 北京大学的出来的
💻 CPP
字号:
#include "stdio.h"

__int64 a[3][4];

__int64 calc(int x,int y,int z)
{
	return a[0][x]*(a[1][y]*a[2][z]-a[1][z]*a[2][y])
			-a[0][y]*(a[1][x]*a[2][z]-a[1][z]*a[2][x])
			+a[0][z]*(a[1][x]*a[2][y]-a[1][y]*a[2][x]);	
}

int main()
{
	int t,i,j;
	__int64 temp[4];
	scanf("%d",&t);
	while(t--)
	{
		for(i=0;i<3;i++)
		{
			for(j=0;j<4;j++)
			{
				scanf("%I64d",&a[i][j]);	
			}	
		}
		temp[0]=calc(0,1,2);
		temp[1]=calc(3,1,2);
		temp[2]=calc(0,3,2);
		temp[3]=calc(0,1,3);
		printf("%I64d %I64d %I64d %I64d\n",temp[1],temp[2],temp[3],temp[0]);
		if (temp[0]==0)
		{
			printf("No unique solution\n\n");	
		}
		else
		{
			printf("Unique solution: %.3f %.3f %.3f\n\n",temp[1]/(double)temp[0],temp[2]/(double)temp[0],temp[3]/(double)temp[0]);	
		}	
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -