-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassisted-compiler-linux-it.cpp
84 lines (84 loc) · 3.32 KB
/
assisted-compiler-linux-it.cpp
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include <string>
using namespace std;
int main(){
string filename="", name="";
int scelta=0;
char continua;
bool cont;
do{
system("clear");
std::cout<<"\033[1;31m[Compilatore File C/C++ ~ by Gab8bit]\033[1;37m\n\n";
std::cout<<"\033[1;36mCompilazione Singola:\033[1;37m";
std::cout<<"\n1- Compila un file C\n2- Compila un file C++\n\n";
std::cout<<"\033[1;36mCompilazione Multipla:\033[1;37m";
std::cout<<"\n3- Compila piu' file C\n4- Compila piu' file C++\n\nScelta: ";
std::cin>>scelta;
std::cout<<"\n\n";
switch(scelta){
case 1:{
system("clear");
std::cout<<"\033[1;36m[Compilazione Singola di un file C]\033[1;37m";
std::cout<<"\n\nNome del file: ";
std::cin>>filename;
std::cout<<"\n\n\033[1;33mOutput compilatore:\033[1;37m\n";
name = "g++ " + filename + ".c -o " + filename;
system(name.c_str());
std::cout<<"\n\n";
break;
};
case 2:{
system("clear");
std::cout<<"\033[1;36m[Compilazione Singola di un file C++]\033[1;37m";
std::cout<<"\n\nNome del file: ";
std::cin>>filename;
std::cout<<"\n\n\033[1;33mOutput compilatore:\033[1;37m\n";
name = "g++ " + filename + ".cpp -o " + filename;
system(name.c_str());
std::cout<<"\n\n";
break;
};
case 3:{
system("clear");
std::cout<<"\033[1;36m[Compilazione Multipla di file C]\033[1;37m";
std::cout<<"\n\nNumero di file: ";
int num, i=0;
std::cin>>num;
string filenames[num];
while(i<num){
std::cout<<"\nNome del file: ";
std::cin>>filenames[i];
std::cout<<"\n\n\033[1;33mOutput compilatore:\033[1;37m\n";
name = "g++ " + filenames[i] + ".c -o " + filenames[i];
system(name.c_str());
std::cout<<"\n\n------------------";
++i;
}
break;
};
case 4:{
system("clear");
std::cout<<"\033[1;36m[Compilazione Multipla di file C++]\033[1;37m";
std::cout<<"\n\nNumero di file: ";
int num, i=0;
std::cin>>num;
string filenames[num];
while(i<num){
std::cout<<"\nNome del file: ";
std::cin>>filenames[i];
std::cout<<"\n\n\033[1;33mOutput compilatore:\033[1;37m\n";
name = "g++ " + filenames[i] + ".cpp -o " + filenames[i];
system(name.c_str());
std::cout<<"\n\n------------------";
++i;
}
break;
};
};
std::cout<<"\n\n\nCompilare altri file? (y/n) ";
std::cin>>continua;
if(continua == 'y' || continua == 'Y'){
cont=true;
}else cont=false;
}while(cont);
}