#include<stdio.h>
#include<stdlib.h>
/*题目:将一个数组逆序输出*/
int main()  {
    system("color 1F");  // 设定显示框为蓝底白字
    system("mode con cols=80 lines=30");  //固定显示框尺寸
/******************************************程序主体分割线(顶部)*************************/
int i,j; 
int a[100];
char ch;
while(1){
printf("请输入一个数组,输入完毕按q确认\n");
for(i=0;i<100;i++){
    printf("请输入第%d个数组元素",i+1);
    scanf("%d",&a[i]);
    ch=getchar();
    if(ch=='q')
    break;
    }
printf("逆序输出:\n");
for(j=i-1;j>=0;j--)
    printf("%d ",a[j]);

printf("\n----------------------------------------------------------------------------\n");

}

/******************************************程序主体分割线(底部)***************************/
    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2022-02-25
  • 2021-04-06
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-07-02
  • 2022-12-23
相关资源
相似解决方案