-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (30 loc) · 793 Bytes
/
main.cpp
File metadata and controls
36 lines (30 loc) · 793 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
30
31
32
33
34
35
36
#include <iostream>
#include "partie1.h"
#include "partie2.h"
//Quetion12: faire un programme qui compresse ou decompresse
int main(int argc, char* argv[]){
std::string src,dest;
std::cout << "Entrer le fichier source" << std::endl;
std::cin >> src;
std::cout << "Entrer le fichier destination" << std::endl;
std::cin >> dest;
int choix;
do{
std::cout << "Compresser (1) ou Decompresser(2)?" << std::endl;
std::cin >> choix;
if(choix!=1 && choix!=2)
std::cout << "Choix incorrect. Retaper (1) ou (2)." << std::endl;
} while(choix!=1 && choix!=2);
utilitaire2 u;
if (choix==1)
{
u.compresser(src,dest);
std::cout << "Compression terminee" << std::endl;
}
else
{
u.decompresser(src,dest);
std::cout << "Decompression terminée" << std::endl;
}
return 0;
}