C语言编写输入:A={1,2,3,4,5},输入一个正整数2,屏幕上输出3,输入5则没有

速求!!!拜托

#include<stdio.h>
#define N 5
void main() { int a[N]={1,2,3,4,5},n;
  scanf("%d",&n);
  if ( n>=0 && n<N ) printf("%d\n",a[n]);
}

温馨提示:答案为网友推荐,仅供参考
相似回答