hdu1098-Ignatius's puzzle

http://acm.hdu.edu.cn/showproblem.php?pid=1098

#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;

int main()
{
	int k ;
	while( scanf( "%d" , &k ) != EOF )  
	{
		if( k % 65 == 0 )
		{
			printf( "no\n" );
			continue ;
		}
		int i ;
		for( i = 1 ; i < 66 ; ++i )
		{
			if( ( i * k + 18 ) % 65 == 0 )
				break ;
		}
		if( i >= 66 )
			printf( "no\n" );
		else
			printf( "%d\n" , i  );
	}
	return 0 ;
}	


 

你可能感兴趣的:(hdu1098-Ignatius's puzzle)