Skip to content

Commit

Permalink
Problem 206
Browse files Browse the repository at this point in the history
  • Loading branch information
themicp committed Apr 20, 2012
1 parent 3a636eb commit f0a1c91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Binary file added problem206/a.out
Binary file not shown.
27 changes: 27 additions & 0 deletions problem206/problem206.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <cstdio>

using namespace std;

long long int a = 1100000000, b = 1389026700;

bool valid( long long int n ) {
int i, t;
for ( i = 10; i > 0; --i ) {
t = i % 10;
if ( n % 10 != t ) {
return false;
}
n /= 100;
}
return true;
}

int main() {
for ( ; a <= b; ++a ) {
if ( valid( a * a ) ) {
printf( "%lli^2 = %lli\n", a, a * a );
return 0;
}
}
return 0;
}

0 comments on commit f0a1c91

Please sign in to comment.