#include <stdio.h> int main(void) { int i; int va[5]={1,2,3,4}; int vb[5]; for (i=0;i<5;i++) { vb[i]=va[i]; printf("vb[%d]%3d\n",i,vb[i]); } system("pause"); return 0; }
#include <stdio.h> int main(void) { int i; int vx[5]; for (i=0;i<4;i++) { int temp=vx[i]; vx[i]=vx[4-i]; vx[4-i]=temp; } for (i=0;i<5;i++) printf("vx[%d]=%d\n",i,vx[i]); return 0; }
#include <stdio.h> int main(void) { int i; int vx[5]; int sum=0; puts("请输入学生分数"); for(i=0;i<5;i++) { printf("%2d号:",i+1); scanf("%d",&vx[i]); sum+=vx[i]; } printf("总分%5d\n平均值%5.1f\n",sum,(double)sum/5); return 0; }
时间: 2024-10-09 08:36:19