#include<iostream>
using namespace std;
int main()
{
long long int n,a;
while(1)
{
cin>>n;
if(n==0)
break;
if(n%11==0)
{
cout<<n<<" "<<"is a multiple of 11."<<endl;}
else
cout<<n<<" "<<"is not a multiple of 11."<<endl;
}
return 0;
}
#include
using namespace std;
int main()
{
long long int n,a;
while(1)
{
cin>>n;
if(n==0)
break;
if(n%11==0)
{
cout<<n<<" "<<"is a multiple of 11."<<endl;}
else
cout<<n<<" "<<"is not a multiple of 11."<<endl;
}
return 0;
}
N 最大可能到 1000 位數。
宣告long long int也無法處理這麼大的數字
要用string 詳見其他解題報告