摘要: #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-25 15:44 孔德金19电信14 阅读(149) 评论(1) 推荐(0)
摘要: #include <stdio.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; }STU; // 函数声明 void i 阅读全文
posted @ 2019-12-18 17:45 孔德金19电信14 阅读(137) 评论(1) 推荐(0)
摘要: // 这个程序用于观察数组中的一组数据元素在内存中是否是连续存放的 // 以及数组元素的直接访问与间接访问 #include <stdio.h> #include <stdlib.h> const int N=3; int main() { int a[N] = {1, 2, 3}; // 定义一维 阅读全文
posted @ 2019-12-13 22:09 孔德金19电信14 阅读(196) 评论(2) 推荐(0)
摘要: #include <math.h> #include <stdio.h> #include <stdlib.h> // 函数声明 void solve(double a, double b, double c); // 主函数 int main() { double a, b, c; printf( 阅读全文
posted @ 2019-11-27 22:45 孔德金19电信14 阅读(135) 评论(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-16 23:20 孔德金19电信14 阅读(103) 评论(1) 推荐(0)
摘要: 1一致 2一致 3要求以8宽度和2宽度输出,1234只有4宽度,所以前者不一致后者一致 4进度转化所以前两个不一致/8宽度保留一位不一致/0宽度保留两位不一致/转化为指数不一致 5双精度不一致 6宽度3输出不一致 7一致/宽度15不一致/宽度10保留5位字符不一致/宽度2保留五位字符不一致/保留3为 阅读全文
posted @ 2019-11-02 19:50 孔德金19电信14 阅读(161) 评论(1) 推荐(0)
摘要: #include <stdio.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); if(x%2==1) printf("是奇数"); else printf("是偶数"); return 0; } #include <stdio.h> int main() { int days; printf("输入一个整数: \n"); s 阅读全文
posted @ 2019-10-20 15:41 孔德金19电信14 阅读(97) 评论(0) 推荐(0)
摘要: 很容易打错,太慢了,慢慢练。 阅读全文
posted @ 2019-10-20 15:06 孔德金19电信14 阅读(87) 评论(0) 推荐(0)