Guest User

Untitled

a guest
Jun 5th, 2013
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <regex>
  4.  
  5. using namespace std;
  6. #define DOT "."
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. int number;
  11. string value;
  12. cout << "Zadejte číslo: ";
  13. cin >> value;
  14.  
  15. cout << "Hodnota je: " << value << DOT << endl;
  16.  
  17. regex reg("^[0-9]+$");
  18.  
  19. if(regex_match(value, reg))
  20. {
  21. number = atoi(value.c_str());
  22. cout << "Zadané číslo je " << number << DOT << endl;
  23. }else cout << "Hodnota musí být číslo" << DOT << endl;
  24.  
  25. system("PAUSE");
  26. return EXIT_SUCCESS;
  27. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×