#include<bits/stdc++.h>
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
#define putcase cout<<"Case "<<++cse<<":"
#define putcase2 cout<<"Case #"<<++cse<<":"
using namespace std;
int main()
{
int i,j,s;
char n[1050];
while(1)
{
s=0;
scanf("%s",&n);
i=strlen(n);
for(j=0; j<i; j++)
{
s=s*10+n[j]-'0';
s=s%11;
}
if(s==0 && i==1) break;
else if(s==0)
printf("%s is a multiple of 11.\n",n);
else printf("%s is not a multiple of 11.\n",n);
}
return 0;
}
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
#define putcase cout<<"Case "<<++cse<<":"
#define putcase2 cout<<"Case #"<<++cse<<":"
using namespace std;
int main()
{
int i,j,s;
char n[1050];
while(1)
{
s=0;
scanf("%s",&n);
i=strlen(n);
for(j=0; j<i; j++)
{
s=s*10+n[j]-'0';
s=s%11;
}
if(s==0 && i==1) break;
else if(s==0)
printf("%s is a multiple of 11.\n",n);
else printf("%s is not a multiple of 11.\n",n);
}
return 0;
}
No comments:
Post a Comment