标签:
#include<stdio.h>
main()
{
long int p;
int n;
double q;
printf("--------------------------------------------------------------------\n");
printf("2 to power n n 2 to power -n\n");
printf("--------------------------------------------------------------------\n");
p=1;
for(n=0;n<21;++n)
{
if(n==0)
p=1;
else p=p*2;
q=1.0/(double)p;
printf("%101d %10d %20.12lf\n",p,n,q);
}
printf("-------------------------------------------------------------------------\n");
int a;
scanf("%d",&a);
if(a%4==0&&a%100!=0||a%400==0)
printf("是闰年");
else printf("不是闰年");
}
标签:
原文地址:http://www.cnblogs.com/haogong10333/p/4905242.html