#include<stdio.h>
#include<stdlib.h>
typedef struct student
{
int xuehao;
char name[4];
int point1;
int point2;
int point3;
struct student *next;
}Linklists;
main()
......................
阅读全部
|
静战者
贴于 2021年12月21日 15:57
hide
bbsi
#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
kuankuan
贴于 2021年12月15日 20:02
hide
bbsi
#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=20; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
Walter2021
贴于 2021年12月2日 18:52
hide
bbsi
#include <stdio.h>
#include <stdlib.h>
int rand2(int min, int max)
{
static unsigned long long z = 1, d = 0, s = 0, i = 256;
static unsigned char* zz = (unsigned char*)&z, * dd = (unsigned char*)&d, *ss = (unsigned char*)&s;
if ((++i) >= 256) { if (d) free((void*)d); d = (unsigned long long)malloc(8); i = 0; } // 產生隨機堆位址到d
z = z * 17 + 139; // 線性求餘法產生0~256之間的隨機數到z
ss[0] = zz[0] + dd[0] + dd[7] + ss[3]; // 隨機數和堆位址混合到ss
ss[1] = zz[1] + dd[1] + dd[6] + ss[0];
......................
阅读全部
|
udefine
贴于 2021年11月29日 19:43
hide
bbsi
#include <stdio.h>
int main() {
printf("我在编程中国学C语言\n\n");
// 练习一下循环的使用
int i;
for (i=1; i<=200; i++) {
printf("我爱编程中国 %d 次\n", i);
}
printf("\n\n绘制一个心形图案:");
......................
阅读全部
|
魏23
贴于 2021年11月27日 09:48
hide
bbsi
#include <stdio.h>
int main() {
int i;
for (i=1; i<=20; i++) {
}
for (float y = 1.5f; y > -1.5f; y -= 0.1f) {
for (float x = -1.5f; x < 1.5f; x += 0.05f) {
float a = x * x + y * y - 1;
putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' ');
}
......................
阅读全部
|
kwx123456
贴于 2021年11月26日 20:57
hide
bbsi
/**
* 【程序5】
* 题目:三色球问题。若一个口袋中放有12个球,其中有3个红的。3个白的和6个黒的,问从中任取8个共有多少种不同的颜色搭配?
*/
#include<stdio.h>
int main()
{ int i=0,j=0,count=0;
printf(" RED BALL WHITE BALL BLACK BALL\n");
printf("-------------------------------------------\n");
......................
阅读全部
|
GST_1208
贴于 2021年11月25日 19:25
hide
bbsi
/**
* 【程序5】
* 题目:三色球问题。若一个口袋中放有12个球,其中有3个红的。3个白的和6个黒的,问从中任取8个共有多少种不同的颜色搭配?
*/
#include<stdio.h>
int main()
{ int i=0,j=0,count=0;
printf(" RED BALL WHITE BALL BLACK BALL\n");
printf("****************************************\n");
......................
阅读全部
|
GST_1208
贴于 2021年11月25日 19:20
hide
bbsi
/**
* 【程序2】
* 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月
* 后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?
* 程序分析:兔子的规律为数列1,1,2,3,5,8,13,21....
*/
#include<stdio.h>
long int fib(int n)
{
......................
阅读全部
|
GST_1208
贴于 2021年11月25日 18:30
hide
bbsi