C语言
-
C语言二进制文件随机访问-C语言基础教程实例源码|
C语言二进制文件随机访问 /* randbin.c -- random access, binary i/o */ #include stdio.h #include stdlib.h #define ARSIZE 1000 int main () { double numbers [ ARSIZE ]; doubl...
-
C示例查找Prime编号的程序-C语言实例教程|
C示例查找Prime编号的程序 #include stdio.h int main () { int loop , number ; int prime = 1 ; number = 11 ; for ( loop = 2 ; loop number ; loop ++ ) { if (( number % loop ) =...
-
C语言文件追加实例-C语言基础教程实例源码|
C语言文件追加实例 /* append.c -- appends files to a file */ #include stdio.h #include stdlib.h #include string.h #define BUFSIZE 4096 #define SLEN 81 void append ( FILE * so...
-
C示例阿姆斯壮数字计划-C语言实例教程|
C示例阿姆斯壮数字计划 #include stdio.h int main () { int arms = 153 ; int check , rem , sum = 0 ; check = arms ; while ( check != 0 ) { rem = check % 10 ; sum = sum + ( re...
-
C语言函数文件随机访问-C语言基础教程实例源码|
C语言函数文件随机访问 /* reverse.c -- displays a file in reverse order */ #include stdio.h #include stdlib.h #define CNTL_Z /* eof marker in DOS text files */ #define SLEN...
-
C语言fprintffscanf函数-C语言基础教程实例源码|
C语言fprintf fscanf函数 /* addaword.c -- uses fprintf(), fscanf(), and rewind() */ #include stdio.h #include stdlib.h #include string.h #define MAX 41 int main ( void ) { FILE *...
-
C语言文件压缩实例-C语言基础教程实例源码|
C语言文件压缩实例 // reducto.c -- reduces your files by two-thirds! #include stdio.h #include stdlib.h // for exit() #include string.h // for strcpy(), strcat() #define LEN ...
-
C示例反转一行的程序-C语言实例教程|
C示例反转一行的程序 #include stdio.h #include string.h int string_length ( char s []) { int i = 0 ; while ( s [ i ] != � ) i ++ ; return i ; } void string_reverse ( char ...
-
C示例用于反转一行中的单词的程序-C语言实例教程|
C示例用于反转一行中的单词的程序 #include stdio.h #include string.h int string_length ( char s []) { int i = 0 ; while ( s [ i ] != � ) i ++ ; return i ; } void stri...
-
C语言标准IO实例-C语言基础教程实例源码|
C语言标准IO实例 /* count.c -- using standard I/O */ #include stdio.h #include stdlib.h // exit() prototype int main ( int argc , char * argv []) { int ch ; // place to store e...
-
C实例字符串字谜-C语言实例教程|
C实例 字符串字谜 #include stdio.h #include string.h int main ( void ) { char s1 [] = recitals ; char s2 [] = articles ; char temp ; int i , j ; int n = strlen ( s1 ); int n1 ...
-
C语言内存-C语言基础教程实例源码|
C语言内存 // where.c -- wheres the memory? #include stdio.h #include stdlib.h #include string.h int static_store = 30 ; const char * pcg = String Literal ; int main () { int aut...
-
C实例连接两个字符串-C语言实例教程|
C实例 连接两个字符串 #include stdio.h #include string.h int main () { char s1 [ 10 ] = Taj ; char s2 [] = Mahal ; int i , j , n1 , n2 ; n1 = strlen ( s1 ); n2 = strlen ( s2...
-
C语言动态数组-C语言基础教程实例源码|
C语言动态数组 /* dyn_arr.c -- dynamically allocated array */ #include stdio.h #include stdlib.h /* for malloc(), free() */ int main ( void ) { double * ptd ; int max ; int num...
-
C实例比较字符串-C语言实例教程|
C实例 比较字符串 #include stdio.h int main () { char s1 [] = advise ; char s2 [] = advice ; int n = 0 ; unsigned short flag = 1 ; while ( s1 [ n ] != � ) { if ( s1 [ n ] !=...
-
C语言掷骰子程序-C语言基础教程实例源码|
C语言掷骰子程序 //diceroll.h extern int roll_count ; int roll_n_dice ( int dice , int sides ); /* diceroll.c -- dice role simulation */ /* compile with mandydice.c */ #includ...
-
C实例交互字符串-C语言实例教程|
C实例 交互字符串 #include stdio.h int main () { char s1 [] = TajMahal ; char s2 [] = Dazzling ; char ch ; int index = 0 ; //Character by Character approach printf ( Before Sw...
-
C语言随机数函数-C语言基础教程实例源码|
C语言随机数函数 /* rand0.c produces random numbers */ /* uses ANSI C portable algorithm */ static unsigned long int next = 1 ; /* the seed */ unsigned int rand0 ( void ) { /*...
-
C示例程序搜索字符串-C语言实例教程|
C示例程序搜索字符串 #include stdio.h #include string.h int main () { char s1 [] = Beauty is in the eye of the beholder ; char s2 [] = the ; int n = 0 ; int m = 0 ; int time...
-
C语言不同的存储类型-C语言基础教程实例源码|
C语言不同的存储类型 // parta.c --- various storage classes // compile with partb.c #include stdio.h void report_count (); void accumulate ( int k ); int count = 0 ; // file...