测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A27150. 下面程序的输出为( )。#include <iostream> const int N=10; int ch[N][N][N]; int main(){ for(int x=0;x<N;x++) for(int y=0;y<N;y++) for(in tz=0;z<N;Z++) if(x==0 &&y==0 && z == 0) ch[x][y][z]= 1; else { if(x >0) c…

单选题 困难

题目描述

下面程序的输出为(    )。

#include <iostream>
const int N=10;
int ch[N][N][N];
int main(){
	for(int x=0;x<N;x++)
	   for(int y=0;y<N;y++)
          for(in tz=0;z<N;Z++)
             if(x==0 &&y==0 && z == 0)
                ch[x][y][z]= 1;
             else {
                 if(x >0)
                    ch[x][y][z]+= ch[x-1][y][z];
                 if(y >0)
                    ch[x][y][z]+= ch[x][y - 1][z];
                 if(z >0)
                    ch[x][y][z]+= ch[x][y][z - 1];
              }
     std::cout<< ch[1][2][3]<< std::endl;
	 return 0;
}

选项(单选)

上一题 下一题