//第一 package shangtang; import java.util.Scanner; public class Main1 {     public static void main(String[] args) {         Scanner sc = new Scanner(System.in);         String input = sc.nextLine();         String[] rowAndCol = input.split(" ");         if(rowAndCol.length != 2)             throw new RuntimeException("输入有误");         int row = Integer.valueOf(rowAndCol[0]);         int col = Integer.valueOf(rowAndCol[1]);         int[][] dp = new int[row][col];         for(int i=0;i<row;i++){             for(int j=0;j<col;j++){                 if(i==0 || j==0){                     dp[i][j] = 1;                 }else{                     dp[i][j] = dp[i-1][j]+dp[i][j-1];                 }             }         }         System.out.println(dp[row-1][col-1]);     } }
点赞 1

相关推荐

06-11 17:39
门头沟学院 Java
小呆呆的大鼻涕:卧槽,用户彻底怒了
点赞 评论 收藏
分享
06-25 09:33
厦门大学 Java
程序员饺子:现在日常估计没啥hc了,等到八月多估计就慢慢有了。双九✌🏻不用焦虑的
投递快手等公司8个岗位
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务