MAYA

MAYA

#include<stdio.h>
int main()
{
long long int result=0;
char temp;
int n,t;
int count;
scanf("%d%c",&n,&temp);
while(n!=0)
{
result=0;
t=n;
while(t>0)
{
scanf("%c",&temp);
count=0;
while(temp!='\n')
{
if(temp=='S')count+=0;
else if(temp=='.')count+=1;
else if(temp=='-')count+=5;
scanf("%c",&temp);
}
if(t==1)
result+=count;
else if(t==2)result+=count*20;
else if(t==3)result+=count*360;
else if(t==4)result+=count*7200;
else if(t==5)result+=count*144000;
else if(t==6)result+=count*2880000;
else if(t==7)result+=count*57600000;
t--;
}
printf("%lld\n",result);
scanf("%d%c",&n,&temp);
}
return 0;
}


No comments:

Post a Comment