// Accepted
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <cctype>
#include <sstream>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#define sf scanf
#define pf printf
#define sfint scanf ("%d %d",&a,&b)
#define sfl scanf ("%ld %ld",&a,&b)
#define sfll scanf ("%lld %lld",&a,&b)
#define sfd scanf ("%lf %lf",&a,&b)
#define sff scanf ("%f %f",&a,&b)
#define loop (i,n) for (i=0;i<n;i++)
#define LL long long
#define L long
#define nl puts("")
#define N 10000
#define MOD 10000000007
#define pb push_back
#define pi acos(-1.0)
#define sz size()
#define gc getchar ()
#define ps push
#define clr clear
#define bn begin()
#define ed end()
using namespace std;
int main()
{
int tc,t,n; sf ("%d",&tc);
char four[5] , result[5];
for (t=1;t<=tc;t++)
{
sf ("%s",&four);
//sprintf(four, "%d" , n);
int count=0,d;
/*for (int i=0;i<len;i++)
{
s+=four[i];
}
cout << s;*/
for (int i=32;i<100;i++)
{
sprintf(result, "%d" , i*i);
d=0;
for (int j=0;j<4;j++)
{
if (four[j] != result[j])
{
d++; //cout << "d = " << d << " ";
}
}
if (d==1)
{
count++;
}
}
pf ("Case %d: %d\n",t,count);
}
return 0;
}
Comments
Post a Comment