codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <cstdio> bool check(const char *s) { int n=0; sscanf(s, "%*d%n", &n); return !s[n]; } #define TEST(x) puts(check(#x) ? #x " - yes" : #x " - no") int main(void) { TEST(1); TEST(1.8); TEST(-890); TEST(+890); TEST(0x100); TEST(1e3); TEST(ghjghjghj); TEST(99999999999999999999); return 0; }
Private
[
?
]
Run code
Submit