摘要: 1.1: // 将file1.txt中小写字母转换成大写后,另存为file2.txt #include <stdio.h> #include <stdlib.h> int main() { FILE *fin, *fout; // 定义文件类型指针 int ch; fin = fopen("file 阅读全文
posted @ 2019-12-28 22:16 王道长i 阅读(133) 评论(0) 推荐(0)
摘要: 1: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h>> #include<string.h> #define N 3 // 运行 阅读全文
posted @ 2019-12-23 23:20 王道长i 阅读(86) 评论(0) 推荐(0)
摘要: part1: 一: // 这个程序用于观察数组中的一组数据元素在内存中是否是连续存放的 // 以及数组元素的直接访问与间接访问 #include <stdio.h> #include <stdlib.h> const int N=3; int main() { int a[N] = {1, 2, 3 阅读全文
posted @ 2019-12-17 23:58 王道长i 阅读(172) 评论(1) 推荐(0)
摘要: part1: #include <stdio.h>#include <stdlib.h> // 函数声明void solve(double a, double b, double c); // 主函数 int main() { double a, b, c; printf("Enter a, b, 阅读全文
posted @ 2019-12-01 23:30 王道长i 阅读(133) 评论(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, real, 阅读全文
posted @ 2019-11-18 22:25 王道长i 阅读(118) 评论(3) 推荐(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,wo 阅读全文
posted @ 2019-11-05 23:08 王道长i 阅读(168) 评论(2) 推荐(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"); sca 阅读全文
posted @ 2019-10-19 22:39 王道长i 阅读(175) 评论(1) 推荐(0)