摘要: // 将file1.txt中小写字母转换成大写后,另存为file2.txt #include <stdio.h> #include <stdlib.h> int main() { FILE *fin, *fout; // 定义文件类型指针 int ch; fin = fopen("file1.txt 阅读全文
posted @ 2019-12-26 20:57 枼聪 阅读(59) 评论(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-23 22:40 枼聪 阅读(65) 评论(2) 推荐(0)
摘要: // 这个程序用于观察数组中的一组数据元素在内存中是否是连续存放的 // 以及数组元素的直接访问与间接访问 #include <stdio.h> #include <stdlib.h> const int N=3; int main() { int a[N] = {1, 2, 3}; // 定义一维 阅读全文
posted @ 2019-12-17 09:22 枼聪 阅读(110) 评论(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-12-03 09:21 枼聪 阅读(166) 评论(2) 推荐(0)
摘要: #include <math.h> #include <stdio.h> #include <stdlib.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while 阅读全文
posted @ 2019-11-18 18:12 枼聪 阅读(174) 评论(4) 推荐(0)
摘要: Part1: 格式化输出函数printf()和格式化输入函数scanf() #include <stdio.h> #include<stdlib.h> int main() { int x=1234; float f=123.456; double m=123.456; char ch='a'; c 阅读全文
posted @ 2019-11-02 10:55 枼聪 阅读(178) 评论(2) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> int main() { int x; printf("输入一个整数: \n"); scanf("%d",&x); int y; y = x%2; if( y == 1) printf("是奇数"); else printf("是偶数"); system("pause"); return 0; } #include <s 阅读全文
posted @ 2019-10-17 22:42 枼聪 阅读(110) 评论(0) 推荐(0)