摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> const int N = 10; // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; 阅读全文
posted @ 2019-12-30 21:27 正义丨元素丨铸星 阅读(97) 评论(2) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; 阅读全文
posted @ 2019-12-24 08:38 正义丨元素丨铸星 阅读(232) 评论(3) 推荐(0)
摘要: // 这个程序用于观察数组中的一组数据元素在内存中是否是连续存放的 // 以及数组元素的直接访问与间接访问 #include <stdio.h> #include <stdlib.h> const int N=3; int main() { int a[N] = {1, 2, 3}; // 定义一维 阅读全文
posted @ 2019-12-16 21:20 正义丨元素丨铸星 阅读(161) 评论(3) 推荐(0)
摘要: //寻找两个整数之间的所有素数(包括这两个整数),把结果保存在数组bb中,函数返回素数的个数。 // 例如,输入6和21,则输出为:7 11 13 17 19。 #include <stdio.h> #include <stdlib.h> #define N 1000 int fun(int n,i 阅读全文
posted @ 2019-12-02 22:23 正义丨元素丨铸星 阅读(112) 评论(1) 推荐(0)
摘要: // 一元二次方程求解 // 重复执行, 直到按Ctrl+D或Ctrl+E结束 // #include <math.h> #include <stdio.h> #include <stdlib.h> int main() { float a, b, c, x1, x2; float delta, r 阅读全文
posted @ 2019-11-18 17:08 正义丨元素丨铸星 阅读(156) 评论(1) 推荐(0)
摘要: #include<stdio.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; char a[]="Hello, world!"; // 定义一个数组a,数组中连续存放了字符串常量hello,wor 阅读全文
posted @ 2019-11-04 10:16 正义丨元素丨铸星 阅读(202) 评论(3) 推荐(0)
摘要: #include<stdio.h> int main() { printf("hello,mars\n"); return 0; } #include<stdio.h> int product (int,int); int main (void) { int x,y,s; scanf("%d %d",&x,&y); s=product(x,y); printf("The mul is:%d",s) 阅读全文
posted @ 2019-10-17 22:44 正义丨元素丨铸星 阅读(134) 评论(0) 推荐(0)