-
NUIST 《程序设计基础》 实验6
第六次实验课~ 点击展开实验1~3 Task1 <task1.c> 源代码 点击查看代码 #include <stdio.h> #define N 5 void input(int x[], int n); void output(int x[], int n); void find_min_max -
6
4 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 售价 int s -
实验6
test1 点击查看代码 #include<stdio.h> #include<string.h> #define N 2 typedef struct student{ int id; char name[20]; char subject[20]; double perf; double mid -
实验7
实验任务4 代码 #include<stdio.h> #define N 100 int main() { int line = 1, count = 0; FILE* fp; char ch; fp = fopen("C:\\Users\\kongj\\Downloads\\data4_20251 -
实验六
任务4 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double sales_ -
实验7
实验任务4 源代码 #include <stdio.h> #include <ctype.h> int main(){ FILE *fp; char ch; int lines=0; int chars=0; fp=fopen("data4.txt","r"); if(fp==NULL){ prin -
实验六
任务1 任务2 任务3 任务4 #include <stdio.h> #include <string.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // -
实验六
任务四 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_price; // 售价 int -
实验6
实验任务1 实验任务2 实验任务3 3.1 实验任务4 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 doubl -
实验6
1.实验任务1 此部分书写内容: 给出contestant.hpp, utils.hpp, task1.cpp源代码及运行结果截图(屏幕输出截图,及,生成数据文件ans.txt截图) contestant.hpp 点击查看代码 #pragma once #include <iomanip> #inc -
实验6
实验任务1 task1.c 点击查看代码 #include <stdio.h> #include <string.h> #define N 3 // 运行程序输入测试时,可以把N改小一些输入测试 typedef struct student { int id; // 学号 char name[20] -
第四章作业
一、贪心算法分析“选点问题” 首先明确选点问题的经典描述:给定数轴上的n个闭区间[a_i, b_i],选择最少的点,使得每个区间至少包含一个选点。 贪心策略 核心策略:按区间的右端点从小到大排序,依次选择每个区间的右端点作为选点,若当前区间已包含已选点则跳过,否则选择当前区间的右端点。 具体步骤: -
实验6
Task1 源代码 Contestant.h #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓 -
实验6
task1.c task1.c 1 #include <stdio.h> 2 #include <string.h> 3 #define N 3 4 typedef struct student { 5 int id; 6 char name[20]; 7 char subject[20]; 8 d -
实验六
任务一 contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓名 st -
实验6
实验六 实验任务一代码 contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; -
实验六
实验六 任务一: 代码部分: utils.hpp: #pragma once #include <fstream> #include <iostream> #include <stdexcept> #include <string> #include <vector> #include "conte -
实验6
任务1:源代码: 1 #pragma once 2 #include <iomanip> 3 #include <iostream> 4 #include <string> 5 6 struct Contestant { 7 long id; // 学号 8 std::string name; // -
实验报告六
实验四: 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double sales -
实验6
实验任务1 contestant.hpp #pragma once #include <iomanip> #include <iostream> #include <string> struct Contestant { long id; // 学号 std::string name; // 姓名