Generation

generate functionSun, 28 May 2023

//学生1~3の各ランニング{1000, 1200, 1100}, {900, 1000, 1020}, {950, 1050, 1000}を2次元配列に初期化(int型)

int x[3][3]; int y[3][3]; int z[3][3]; for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ if(i==0){ x[i][j]=1000+j*100; }else if(i==1){ x[i][j]=900+j*100; }else if(i==2){ x[i][j]=950+j*50; } } } for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ cout<<x[i][j]<<" "; } cout<<endl; }

Want to kickstart your project?Use the new AI Studio to create your code