Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

090928ÈÕcÓïÑÔѧϰÈռǣ¨ÎļþI/O)

#include<stdio.h>
#include<stdlib.h>
#define MAX 41
static int i=0;
int main(void)
{
FILE *fp;
char words[MAX];
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stdout,"Can't open \" word\" file\n");
exit(1);
}
puts("Enter words to add to the file,press the enter.");
puts("Key at the begining of a line to terminate.");
while(gets(words)!=NULL&&words[0]!='\0')
{
fprintf(fp,"%s",words);
i++;
}
rewind(fp);
while(fscanf(fp,"%s",words)==1)
{
puts(words);
}
if(fclose(fp)!=0)
{
fprintf(stderr,"Error closing file.\n");
}
return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000
int main(void)
{
FILE *fp;
char words[MAX];
int wordct=0;
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stderr,"Can't open \" word\" file\n");
exit(1);
}
rewind(fp);
while (fgets(words, MAX - 1, fp) != NULL)
wordct++;
rewind(fp);
puts("Enter words to add to the file,press the enter.");
puts("Key at the begining of a line to terminate.");
while(gets(words)!=NULL&&words[0]!='\0')
{
fprintf(fp,"%d:%s",++wordct,words);
}
puts("File contents:");
rewind(fp);
while(fgets(words,MAX-1,fp)!=NULL)
{
fputs(words,stdout);
}
if(fclose(fp)!=0)
{
fprintf(stderr,"Error closing file.\n");
}
return 0;
}
/*ÎļþÃûÓÉÓû§ÊäÈ룬½¨Á¢Ò»¸öÑ­»·£¬ÈÃÓû§ÊäÈëÎļþλÖã¬
Ôò´òӡλÖõ½ÏÂÒ»¸ö»»ÐзûÖ®¼äµÄ×Ö·û£¬µ±ÊäÈë·ÇÊý×Ö×Ö·ûʱÍ˳ö*/
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#define MAX 41
int main(void)
{
FILE *fp;
char ch;
char file[MAX];
long address;
puts("ÇëÊäÈëÎļþÃû");
gets(file);
if((fp=fopen(file,"rb"))==NULL)
{
fprintf(stderr,"Can't open the %s\n",file);
exit(1);
}


printf("ÇëÊäÈëÒ»¸öÎļþλÖÃ\n");
while(1)
{
scanf("%ld",&address);
if(isdigit(address))
{
break;
}
fseek(fp,address,SEEK_SET);

while((ch=getc(fp))!='\n' && (ch=getc(fp)


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

strassen in c language.

#include<stdio.h>
#define N 8
void input(int n,int p[N][N])
{
 int i,j;
 for(i=0;i<n;i++)
 {
  printf("please input the %d line:\n",i+1);
  for(j=0;j<n;j++)
  {
  scanf("%d",&p[i][j]);
 }
}
 }
void output(int n,int p[N][N])
......

¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2


¡¶Cר¼Ò±à³Ì¡·Ñ§Ï°×ܽá2
 
ת×Ô £º http://blog.chinaunix.net/u2/87570/showart_2120069.html
±àÒëÆ÷×öÁËЩʲô
 
                 ͼ1£º±àÒëÆ÷ͨ³£·Ö¸î³É¼¸¸ö¸üСµÄ³ÌÐò
 
¾²Ì¬Á´½ÓÓ붯̬Á´½Ó
 
  ......

C static

  CÓïÑÔ³ÌÐò¿ÉÒÔ¿´³ÉÓÉһϵÁÐÍⲿ¶ÔÏ󹹳ɣ¬ÕâЩÍⲿ¶ÔÏó¿ÉÄÜÊDZäÁ¿»òº¯Êý¡£¶øÄÚ²¿±äÁ¿ÊÇÖ¸¶¨ÒåÔÚº¯ÊýÄÚ²¿µÄº¯Êý²ÎÊý¼°±äÁ¿¡£Íⲿ±äÁ¿¶¨ÒåÔÚº¯ÊýÖ®Í⣬Òò´Ë¿ÉÒÔÔÚÐí¶àº¯ÊýÖÐʹÓá£ÓÉÓÚCÓïÑÔ²»ÔÊÐíÔÚÒ»¸öº¯ÊýÖж¨ÒåÆäËüº¯Êý£¬Òò´Ëº¯Êý±¾ÉíÖ»ÄÜÊÇ“ÍⲿµÄ”¡£
      ÓÉÓÚ ......

20100601 cÏÝÚåÓëÖ¸Õë¶ÁÊé±Ê¼Ç£¨µÚËÄÎåÁùÕ£©

  ÕâÈýÕÂÖ÷Òª½²ÁËCÓïÑÔµÄÁ´½Ó¡¢¿âº¯Êý¡¢Ô¤´¦Àí¡£»¹ÊÇÓеã»ÞɬÄѶ®°¡¡£
  Ò»¸öC³ÌÐòÊÇ¿ÉÒÔÓжà¸ö²¿·Ö×é³ÉµÄ£¬µ«ÊDZàÒëÆ÷ÿ´ÎÖ»ÄܱàÒëÒ»¸öÎļþ£¬ÕÒ³öÆäÖеĴíÎó¡£Ä³Ð©CÓïÑÔʵÏÖÌṩÁËÒ»¸ö³ÆÎªlintµÄ³ÌÐò£¬¿ÉÒÔ²¶»ñ´óÁ¿µÄ´ËÀà´íÎó¡£Á¬½ÓÆ÷Ò»°ãÊÇÓë±àÒëÆ÷·ÖÀëµÄ£¬±àÒëÆ÷ÊǰÑC³ÌÐò“·­Ò딳ɶÔÁ¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ