#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
float h = 100.0;
float sum = 0.0;
for (int i = 0; i < 10; i++) {
sum += h;
h = h/2.0 ;
}
printf("%f %f\n\n",h,sum);
}
return 0;
}
时间: 2024-10-28 05:58:07