邀请我?!
#include<stdio.h>#include<math.h>intmain(void){// A0 面积1平方米;长宽比√2:1,是为了对折后长宽比不变。unsignedW=(unsigned)round(1000/sqrt(sqrt(2.0)));unsignedL=(unsigned)round(1000*sqrt(sqrt(2.0)));for(unsignedi=0;i<=10;++i){printf("A%u: %u * %u\n",i,W,L);unsignedtmp=W;W=L/2;L=tmp;}}
输出:
A0: 841 * 1189
A1: 594 * 841
A2: 420 * 594
A3: 297 * 420
A4: 210 * 297
A5: 148 * 210
A6: 105 * 148
A7: 74 * 105
A8: 52 * 74
A9: 37 * 52
A10: 26 * 37