随笔分类 - c++
摘要:#include<stdio.h>#include<stdlib.h> int main(){ FILE *fin;//文件指针 char ch; if((fin=fopen("c:\\mmmmm\\test.txt","r"))==NULL) { printf("read file error!\
阅读全文
摘要:#include<stdio.h>#include<stdlib.h> int main(){ int i; char ch; FILE *fout; if((fout=fopen("c:\\mmmmm\\test.txt","w"))==NULL) { printf("没有找到该文件!\n");
阅读全文
摘要:#include<stdio.h>#include<stdlib.h>#include<string.h> //写函数void writetext(FILE *fw){ char str[80]; gets(str); while(strcmp(str,"-1")!=0) { fputs(str,f
阅读全文
摘要://该程序完成'动态内存分配' #include<stdio.h>#include<stdlib.h> typedef struct node{ int data; struct node *next;}linklist; //主菜单 int menu(){ printf("\n**********
阅读全文
摘要:#include<stdio.h>#define N 5 struct student//数据类型 { int num;//学号 char sname[25];//姓名 char sex[4];//性别 int age;//年龄 }; struct student stu[N]={{1001,"钟丽
阅读全文
摘要:题目: 某班级有4名这学生,每个学生有5门课程。编程实现以下3个要求: (1)求第一门课程的平均成绩; (2)找出有两门以上课程不及格的学生,输出他们的学号和全部课程成绩及平均分; (3)找出平均成绩在90分以上或全部课程成绩在85分以上的学生。 源代码: #include<stdio.h>#inc
阅读全文
摘要:#include<stdio.h>//求最大值的函数int highest(int m[3][4])//形式参数是二维数组{ int i,j; int a=m[0][0];//认为第一个数是最大值 for(i=0;i<3;i++)//外层循环控制行 { for(j=0;j<4;j++)//内层循环控
阅读全文
摘要:#include <stdio.h>int main(){int upper=0,lower=0,digit=0,space=0,other=0,i=0;char *p,s[80];printf("请输入一串字符,包括大写字母、小写字母、数字、空格和其他字符,不超过80个:\n");while ((
阅读全文
摘要://求最高分,最低分,平均分,按大小排序 ,及格/不及格人数 #include<stdio.h>int main(){ int array[10]; int *pointer; int i,j,t; int sum=0,max,min; double aver; int num1=0,num2=0;
阅读全文
浙公网安备 33010602011771号