题解 | #字符逆序#

走方格的方案数

http://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b

import java.util.; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int l = sc.nextInt(); int h = sc.nextInt(); int r=1; int r1=1; for (int i=1;i<=Math.abs((l+h)-l);i++){ r=r(l+h-i+1); r1=r1*i; } int reslut =r/r1; System.out.println(reslut); }

}

}

全部评论

相关推荐

点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务