乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > ASP+<em>EXCEL</em>做了一个小程序,<em>EXCEL</em

ASP+<em>EXCEL</em>做了一个小程序,<em>EXCEL</em

作者:乔山办公网日期:

返回目录:excel表格制作


#include <stdio.h>
#define LIST_INIT_SIZE 10
#define LISTINCREMENT 10
#define ERROR 0
typedef struct{
 int *elem;
 int length;
 int listsize;
} SqList;
void InitList_Sq(SqList *l)
{
 l->elem=(int *)malloc(LIST_INIT_SIZE*sizeof(int));
 if(!l->elem) exit(0);
 l->length=0;
 l->listsize=LIST_INIT_SIZE;
}
int InList(SqList *l)
{
 int *p,*newbase;
 p=l->elem;
 while(1)
 {
  for(;p<l->elem+l->listsize;p++)
  {
   scanf("%d",p);if(*p==-1) break;l->length++;
  }
  if((p==l->elem+l->listsize))
  {
   newbase=(int *)realloc(l->elem,(l->listsize+LISTINCREMENT)*sizeof(int));
   p=l->elem+l->length;
   l->listsize=l->listsize+LISTINCREMENT; 
   if(!l->elem) return ERROR;
  }
  if(*p==-1) break;
 }
 return 1; 
}
void PrList(SqList *l)
{
 int *p,i;
 p=l->elem;
 for(;p<l->elem+l->length;p++)
 printf("%d ",*p);
}
int ListInsert_sq(SqList *l,int i,int e)
{
 int *newbase,*p,*q;
 if(i<1||i>l->length) return ERROR;
 if(l->length==l->listsize)
 {
  newbase=(int *)realloc(l->elem,(l->listsize+LISTINCREMENT)*sizeof(int));
  if(!newbase) return ERROR;
  l->elem=newbase;
  l->listsize+=LISTINCREMENT;
 }
 q=l->elem+i-1;
 for(p=l->elem+l->length-1;p>=q;p--)
 *(p+1)=*(p);
 *q=e;
 l->length+=1;
 return 1;
}
int ListDelet_sq(SqList *l,int i)
{
 int *p,e;
 if((i<1)||(i>l->length)) return ERROR;
 p=l->elem+i-1;
 e=*p;
 for(;p<l->elem+l->length-1;p++)
 *p=*(p+1);
 l->length--;
 printf("要删e799bee5baa6e79fa5e98193e59b9ee7ad94334除的元素是:%d\n",e);
 return 1;
}
void main()
{
 int i,j,n;
 char a;
 SqList la;
 InitList_Sq(&la);
 printf("请输入顺序表中的元素:\n");
 if(!InList(&la)) return ERROR;
 do
 {
  printf("请输入需要插入元素的位置及元素:(a,b)\n");
  scanf("%d,%d",&i,&j);
  if(!ListInsert_sq(&la,i,j)) return ERROR;
  printf("是否还需要插入元素?(N/Y)");
  getchar();
  scanf("%c",&a);
  if(a=='N'||a=='n') break;
 }while(1);
 do
 { 
  printf("请输入需要删除元素的位置:\n");
  scanf("%d",&i);
  if(!ListDelet_sq(&la,i)) return ERROR;
  printf("是否还需要删除元素?(N/Y)");
  getchar();
  scanf("%c",&a);
  if(a=='N'||a=='n') break;
 }while(1);
 printf("最后的顺序表为:\n");
 PrList(&la); 
}



用VBA更方便。C也是C#。非要C#做那就等别人回答吧,VBA可以的话我可以做。

C语言不清楚能不能~~但是asp中是可以的~不过需要一个模板来规定这个格式

相关阅读

关键词不能为空
极力推荐
  • excel减法函数-Excel自学教程:SUMPRODUCT函数

  • 今天带大家来认识一个简单而又复杂的函数:sumproduct。上图是一个非常简单的表格,要算出总价一般都是将单价*数量算出来再求和,结果如D8所示。-excel减法函数

ppt怎么做_excel表格制作_office365_word文档_365办公网