-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruncpp.txt
More file actions
29 lines (26 loc) · 866 Bytes
/
Copy pathruncpp.txt
File metadata and controls
29 lines (26 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function runcpp () {
echo -e "[\e[34mx\e[0m] g++ -std=c++20 -O3 -g -D_GLIBCXX_DEBUG -Wall -Wextra -I . $1 -o a.out"
g++ -std=c++20 -O3 -g -D_GLIBCXX_DEBUG -Wall -Wextra -I . $1 -o a.out
result=$?
if [ $result -ne 0 ]
then
echo -e "[\e[31m-\e[0m] compile failed"
else
echo -e "[\e[32m+\e[0m] successful complie"
echo -e "[\e[34mx\e[0m] run ./a.out"
./a.out
fi
}
function runcppio () {
echo -e "[\e[34mx\e[0m] g++ -std=c++20 -O3 -g -D_GLIBCXX_DEBUG -Wall -Wextra -I . $1 -o a.out"
g++ -std=c++20 -O3 -g -D_GLIBCXX_DEBUG -Wall -Wextra -I . $1 -o a.out
result=$?
if [ $result -ne 0 ]
then
echo -e "[\e[31m-\e[0m] compile failed"
else
echo -e "[\e[32m+\e[0m] successful complie"
echo -e "[\e[34mx\e[0m] run ./a.out"
./a.out < in > out
fi
}