View Code of Problem 3497

#include<stdio.h>
int main()
{
	int A0,A1,A2,i;
	long long sum; 
	while(scanf("%d%d%d",&A0,&A1,&A2)!=EOF)
	{   sum=0;
		for(i=0;i<100;i++)
		{
		  sum=sum+A0+A1+A2;
		  A0=A1;
		  A1=A2;
		  A2=sum;
		} 
		printf("%lld\n",sum);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3497