首页 > 代码库 > C++之算法题模板

C++之算法题模板

main.cpp:

#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

std::vector<string> v;
int len;
void input(){
cin >> len;

}

void output(){
cout << len;
}

int main(){


input();

output();
return 0;
}

 

 

 

Makefile:

CXX = g++
ERROR = 2>error.txt
CXXFLAGS= -g
TARGET = main.exe


SOURCES = main.cpp
IN = < in.txt
#OUT = > out.txt

all:$(SOURCES)
$(CXX) $(SOURCES) $(CXXFLAGS) -o $(TARGET) $(ERROR)
$(TARGET) $(IN) $(OUT)

clean:
del *.exe

 

C++之算法题模板