De quelle manière puis-je optimiser mon programme ? :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
#include <iostream>
 
using namespace std;
 
int main(int argc, char *argv[])
{
    string chaine=argv[1],      cryptee="",     clef=argv[2];    
 
    if (argv[1]==NULL || argv[2]==NULL)
       cout << "Utilisation :" << endl << "CRYPT chaine clef" << endl;
    else
    {
        for (int i(0); i<chaine.length(); ++i)
            cryptee += chaine[i] ^ clef [ i % clef.length() ];
        cout << cryptee;
    }
 
    return 0;
}