第六次作业

#include <stdio.h>
main() {
	int x, y;
	for (x = 0; x <= 35; x++)
	{
		y = 35 - x;
		if (2 * x + 4 * y == 94)
			printf("鸡:%d只 兔子:%d只\n", x, y);
	}
}

  



#include <stdio.h>
main()
{
int i,j;
printf("九九乘法表\n");
for (i = 1; i <= 9; i++)
{
	for (j = 1; j <= i; j++)
		printf("%2d*%d=%2d", j, i, i * j);
	printf("\n");
}
printf("\n");
}

  



#include<stdio.h>
	main() {
	int a, c;
	scanf_s("%d", &a);
	for (c = 2; c < a; c++)
	{
		if (a % c == 0)
			break;
	}
	if (c >= a)
		printf("%d是质数", a);
	else
		printf("%d是合数", a);
}

  



#include <stdio.h>

main()

{

int i, j, k;

for (i = 5; i >= 1; i--)

{

for (j = 1; j < 5 - i; j++)

{

printf(" ");

}

for (k = 1; k <= 2 * i - 1; k++)

{

printf("*");

}

printf("\n");

}

}



posted @ 2021-11-09 10:29  王欣彤  阅读(23)  评论(0)    收藏  举报