Skip to content

Commit

Permalink
Remove namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kbuffardi committed Sep 19, 2023
1 parent ce2805d commit 3404c8d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#include <iostream>

using namespace std;
const int RGB_HEX_LENGTH = 7;

int main(){
string input;
std::string input;

do{
cout << "Enter a color in hex format (#RRGGBB):";
getline(cin, input);
std::cout << "Enter a color in hex format (#RRGGBB):";
std::getline(cin, input);

if( input.size() != RGB_HEX_LENGTH ){
cout << "Please enter the color in hexadecimal format, starting with # followed by six hex values\n";
std::cout << "Please enter the color in hexadecimal format, starting with # followed by six hex values\n";
}
}while( input.size() != RGB_HEX_LENGTH );

cout << "Your hex color is: " << input << endl;
std::cout << "Your hex color is: " << input << std::endl;

return 0;
}

0 comments on commit 3404c8d

Please sign in to comment.