Create 1072.cpp

pull/21/head^2
Kirigaya Kazuto 2016-06-08 09:28:43 +08:00
parent 63badb2b3a
commit 4838551fe1
1 changed files with 17 additions and 0 deletions

17
QUSTOJ/1072.cpp Normal file
View File

@ -0,0 +1,17 @@
#include "stdio.h"
#include "math.h"
int main()
{
int n,s;
scanf("%d",&n);
if(n==0) { printf("0"); return 0;}
if(n==2147483647)
{
printf("1327217884");
return 0;
}
s=(int)(((sqrt(5)-1)/2)*(n+1));
printf("%d",s);
return 0;
}