#import <Foundation/Foundation.h>
unsigned long long perimeter(int n) {
NSMutableArray *numQu = @[@0,@1].mutableCopy;
unsigned long long n0 = 0,n1=1;
for (int i = 2; i<=n+1; i++) {
unsigned long long sum = n0+n1;
n0 = n1;
n1 = sum;
[numQu addObject:@(sum)];
}
unsigned long long tol = 0;
for (NSNumber* ele in numQu) {
tol+=[ele unsignedLongLongValue];
}
return tol*4;
}
Perimeter of squares in a rectangle
Copyright © 2017 Powered by LZH, Theme used GitHub CSS.