写了一个来查找文件夹里面的图片名(都是.jpg),然后和指定的名单进行匹配的一个小脚本。
来检验一下有谁没交。
先去查查如何获取文件的名字,然后直接复制修改
https://blog.youkuaiyun.com/cxf7394373/article/details/7195661 (在这里找到的)
可以通过输入
.\main.exe 文件夹的路径 匹配的名单的路径(我使用的是1.txt)
例
.\main.exe C:\1 C:\1.txt
可以快速筛查还有谁没有交图片。
以上
#include <iostream>
#include <io.h>
#include<stdio.h>
#include<stdlib.h>
#include <string>
#include <vector>
using namespace std;
#define LEN 10
void getFiles(string, vector<string>&);
FILE * open(const char *path,const char *s);
int read(FILE *fp,vector<string>& student_name);
int find(vector<string>& v, string s);
string filename = "";
int main(int argsl, char** args) {
FILE *fp = NULL ;
vector<string>