#include <stdio.h>
int main()
{
int i, j, k, p;
for (i = 5; i > 0; i–)
{
for (k = i; k < 5; k++)
{
printf(" ");
}
for (j = i; j > 0; j–)
{
printf("x ");
}
for (p = i; p > 1; p–)
{
printf(“x “);
}
printf(”\n\n\n”);
}
return 0;
}
#include <stdio.h>
void main()
{
int yeardaynum = 0;
int yearnumber1 = 0, yearnumber2 = 0;
int yearsum = 0;
int year1;
printf(“year1 is you input number about birth year:”);
scanf_s("%d", &year1);
int year2;
printf(“year2 is you input number about now year2”);
scanf_s("%d", &year2);
for (year1 = 1980; year1 < 2030; year1++)
{
if ((year1 + 1) % 4 == 0 && (year1 + 1) % 4 != 100 && (year1 + 1) % 4 == 400)
yearsum += 1;
}
yeardaynum = (year2 - year1 + 1) * 365 + yearsum * 366;
int day1, day2;
int month1, month2;
int yeardaynum1=0;
printf("month1 aboout birth is:");
scanf_s("%d", &month1);
printf("month2 about now is:");
scanf_s("%d", &month2);
printf("day1 is birth day:");
scanf_s("%d", &day1);
printf("day2 is today:");
scanf_s("%d", &day2);
if (year1 % 4 == 0 && year1 != 0 && year1 % 400 == 0)
yearnumber1 == 1;
else
yearnumber1 == 0;
int a[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
int b[12] = { 31,29,31,30,31,30,31,31,30,31,30,31 };
int gu1, gu2;
for (gu1 = 0; gu1 < month1; gu1++)
{
if (yearnumber1 == 1)
yeardaynum1 -= b[gu1];
else if (yearnumber1 == 0)
yeardaynum1 -= a[gu1];
}
if (year1 % 4 == 0 && year1 != 0 && year1 % 400 == 0)
yearnumber2 == 1;
else
yearnumber2 == 0;
for (gu2 = 0; gu2 < month2; gu2++)
{
if (yearnumber2 == 1)
yeardaynum1 += b[gu2];
else if (yearnumber2 == 0)
yeardaynum1 += a[gu2];
}
yeardaynum1 += day2;
yeardaynum1 -= day1;
printf("%d", yeardaynum+yeardaynum1);
return 0;
}