?? 1189.c
字號(hào):
#include <stdio.h>
#include <math.h>
double temp[101]={0};
__int64 first=1;
__int64 a,a1,b,t;
int main(void)
{
int n,m,i,j,k,h,l;
char get;
scanf("%d %d",&n,&m);
b=first=first<<n;
for(;;)
{
scanf("%c",&get);
if(get!=' '&&get!='\n') break;
}
if(get=='*') temp[49]=temp[51]=0.5;
else temp[50]=1;
for(j=49,k=2;k<=n;k++)
{
h=j;
for(l=1;l<=k;)
{
scanf("%c",&get);
if(get==' '||get=='\n') continue;
if(get=='*')
{
temp[h-1]=temp[h]*0.5+temp[h-1];
temp[h+1]=temp[h]*0.5+temp[h+1];
temp[h]=0;
}
h=h+2;
l++;
}
j--;
}
a1=a=temp[50-n+m*2]*first;
if(a==0) printf("0/1\n");
else
{
for(;;)
{
if(b%a)
{
t=b%a;
b=a;
a=t;
}
else break;
}
printf("%I64d/%I64d\n",a1/a,first/a);
}
return 0;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -