📄 tc.c
字号:
#include<stdio.h>
void menu(){
clrscr();
printf("\n\n\n\n\n\n\n\n\n\n\n\n");
printf(" 1:new\n");
printf(" 2:insert\n");
printf(" 3:delet\n");
printf(" 4:turn\n");
printf("\n\n\n please input your select.\n");
}
int A[100];
void main()
{
int x;
void new();
void insert();
void delet();
void turn();
void menu();
while(1)
{
menu();
scanf("%d",&x);
if(x==6) break;
switch(x)
{
case 1:new();break;
case 2:insert();break;
case 3:delet();break;
case 4:turn();break;
}
}}
void new()
{
int y;
clrscr();
for(y=0;y<10;y++)
A[y]=y;
for(y=0;y<10;y++)
printf("A[y]=%d\n",A[y]);
}
void insert()
{
int i,j,k;
clrscr();
printf("please input the number that you want to insert and the position of it\n");
scanf("%d",&j); scanf("%d",&k);
for(i=9;i>k;i--)
A[i+1]=A[i];
A[k]=j;
for(i=0;i<11;i++)
printf("%d",A[i]);
}
void delet()
{
int m,n;
clrscr();
printf("please input the position of the number that you want to delet:\n");
scanf("%d",&n);
for(m=n;m<9;m++)
A[m]=A[m+1];
for(m=0;m<9;m++)
printf("%d",A[m]);
}
void turn()
{
int p,t;
clrscr();
for(p=0;p<5;p++)
{
t=A[p];
A[p]=A[9-p];
A[9-p]=t;
}
for(p=0;p<10;p++)
printf("%d",A[p]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -