This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Problem : 11879 - Multiple of 17. | |
* Status : Accepted. | |
* Author : Md.Mehad Hasan Menon. | |
* Date : 17.01.2015. | |
**/ | |
#include <iostream> | |
#include <string> | |
#include <cstdio> | |
int main() | |
{ | |
std::string bigNum; | |
int n; | |
while(std::cin >> bigNum) | |
{ | |
if(bigNum == "0") | |
break; | |
n = 0; | |
for(int i = 0; bigNum[i]; i++) | |
{ | |
n = n * 10 + (bigNum[i] - '0'); | |
n = n % 17; | |
} | |
if(n == 0) | |
std::cout << "1" << std::endl; | |
else | |
std::cout << "0" << std::endl; | |
} | |
return 0; | |
} |
Comments
Post a Comment