[恢]hdu 1391

2011-12-21 10:39:00

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1391

题意:给出坐标,输出坐标上的数字或No Number。

代码:

# include <stdio.h>


int gao(int x, int y)
{
int ans ;
if (x == y) return 2*x - (x&1) ;
return gao(x, y+2) - 2 ;
}


int main ()
{
int T, x, y ;
scanf ("%d", &T) ;
while (T--)
{
scanf ("%d%d", &x, &y) ;
if (x != y && x != y+2) printf ("No Number\n") ;
else printf ("%d\n", gao(x,y)) ;
}
return 0 ;
}



原文地址:https://www.cnblogs.com/lzsz1212/p/2315316.html